Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grabbing everything but the script
Message
From
01/05/2013 14:12:37
 
 
To
01/05/2013 13:32:50
General information
Forum:
Javascript
Category:
DHTML
Miscellaneous
Thread ID:
01572384
Message ID:
01572386
Views:
40
>I am grabbing the content of the actual page and dumping that into a DIV area inside the parent. I do it like this:
>
>
>window.parent.oDiv.innerHTML=document.body.innerHTML
>
>
>When I do this, it grabs as well the script. What kind of approach can I use so that the script will not be included?

Long long time ago I'd first look if .innerText has the info I need - but often first step was walking down the nodes, eliminating as much of the rest of body.innerWhatever as possible. If not possible, then resort to string massaging innerHTML. As I was analyzing different pages - most not under my control and changed at inoppotune times - I think this approach saved in the long run maintainance time, as I often could build new needed functionality easily out of existing parsing routines. YMMV depending on how many different pagetypes you need to work on.

HTH

thomas
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform