httpwebwitch

msg:3630463 | 1:49 pm on Apr 19, 2008 (gmt 0) |
this is a confusing question if you load AJAX that contains a <script>, then inject that HTML into your DOM, the script you received will usually execute does ebay's API URL "contain" JS, or is it actually a script, with mimetype text/javascript and the whole enchalada? try:
someElementOnYourPage.innerHTML = ajaxRequest.responseText
|
seks

msg:3630655 | 8:13 pm on Apr 19, 2008 (gmt 0) |
It's actually a complete script (about 5+ pages of JS). Yeah that's what I thought it should do, too. The way the tabs are created is through a built in function createNewTab() which takes tab as an argument. My declaration of tab behaves correctly if i document.write() it, but then it opens in a new window when I want it to be in a frame. Perhaps the tab scripts I'm using don't allow js inside the tabs. If I do it through the iframe method (which is commented out on my code posted above), I just see the source code -- it's not being parsed. I think the easiest thing will be for me to throw together a perl script which adds <script> tags to that then I can just put it in an iframe.
|
httpwebwitch

msg:3630711 | 11:17 pm on Apr 19, 2008 (gmt 0) |
i think you're right. Lately I've been using Mootools JS library, which comes with a "Asset.javascript [docs.mootools.net]" class - essentially you can load up an external javascript and execute it with one line of code. Worth a look; might be ideal for what you're doing.
|
seks

msg:3630801 | 7:14 am on Apr 20, 2008 (gmt 0) |
Thanks a lot! I'm taking mootools for a spin and even found a tabs plugin for it.. It seems smooth and lovely :)
|
stuartc1

msg:3632179 | 10:50 am on Apr 22, 2008 (gmt 0) |
Just a thought.... have you tried using eval() for the returned js? I think this is the only way to have the js run when loaded this way. I may be wrong and would be interested in find other ways to do this.
|
|