- Create Account

JS in the loaded window

Forums > HTMLHttpRequest > JS in the loaded window
Author
Message

1) pino71 Group: Members
Posts: 2 Joined: 17 Sep 2007 Location: IP: 160.97.--.--
Hi,
i've a big problem: i need to load some js (like thickbox.js or jquery.js) in the window loaded by the HTMLHttpRequest method.
But when i try to click the link on the loaded window this script non working (with thickbox open a new window and not a overlay window).

Please help me.

Thanks

2) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 203.109.--.--
Embed the source material in the loaded document if it is plain HTML, and the script in the parent document. Loading scripts is very hard to do right, so they should really be in the main document at load time!

Good luck - Angus.

3) pino71 Group: Members
Posts: 2 Joined: 17 Sep 2007 Location: IP: 160.97.--.--
Yes, the script are linked in the parent document.
When i load the document into div i see the right css for example (that are linked in the main document too) but the function not work (i not see any js error in the IE).
I use for example the tablesort.js and the paginator.js to sort and paginate a table loaded into div.

4) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 203.109.--.--
Unless the script has been specifically designed to handle insertion/removal of content on the fly, it will probably fail.

You may need to call any "activation" methods of the script each time you load content, this will again depend on how the script is written. I'd contact the author of the original script perhaps to see what they recommend as this is not really a bug with HTMLHttpRequest at all.

Good luck - Angus.

Post a Reply:

You are not logged in, and will be posting anonymously as a guest. If you want to post using an account, please login at the top of this page.