Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy Paste <script> tag

Status
Not open for further replies.

damipera

Technical User
Dec 1, 2005
134
GB
hi guys, i dont know if this is the right forum for this question, so please bear with me and posted this in other forum but seems not getting looked at. so, my apologies.

can you give some advice please. if i have a page like this which is viewed from a browser which says:

test123


and looked at the source code view and have seen it as:

test123 <script>myscripttest</script>


is it possible for me to copy from the browser-view the text 'test123' and copy/paste it to, say a dreamweaver, but include the <script>myscripttest</script> as well ? is there a way?

thanks for any advice

 
Hi

Well, it can be possible in a certain degree [sup](*)[/sup], as browsers can show the generated source code for a selection, so it could be possible to place it in clipboard too. Definitely solvable with JavaScript from a browser extension, but probably not from a document level script.

[small](*) The displayed source code usually includes abit more than just the selected portion.[/small]


Feherke.
 
Assuming the <script> tags hold all the code, then yes, copying them over would copy the script. However whatever the script does may require something else elsewhere like an onclick event.

Perhaps if you can show us, or explain a bit more what you are wanting to do, we can help you better.



----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top