views:

330

answers:

1

I am trying to access a page that has certain javascript that causes errors and prevents the page from fully rendering.

<script language="Javascript">
parent.hidden.vPageState = parent.hidden.NEW_LIST;
</script>

and

<body  onload="top.menu.activateCell(3);">

Both of these errors are related to the fact that I am accessing the page directly and not via frames.

I've gotten around this by making my own clone of the page and hosting it but I don't like that solution and was wondering if there was a way to somehow

Override/Alter or better yet Erase that code using Javascript injection via Webbrowser control

Thanks

+1  A: 

For the onload event, just replace it with a new function further down the page.

http://haacked.com/archive/2006/02/05/AddingWindowOnloadEventsInJavascript.aspx

The other one might be a little trickier....If you can't remove it, you could technically create a frame around the page which doesn't show, so the code would fire properly.

Kevin
Could you provide an example of how to replace the onload event?
Proximo
I like the creating a parent frame idea, that might solve all my problems.
Proximo