Welcome to WebmasterWorld Guest from 18.104.22.168
Forum Moderators: open
Now this would be fine if I was feeding the script with a POST form or such, but I'm using AJAX to update the tabs.
How do I dynamically update my page with the JS at the url?
//tab = '<iframe src="'+ajaxRequest.responseText+'" width=100% height=7000></iframe>';
tab = '<script src="'+ajaxRequest.responseText+'"></script>';
Where tab is the contents of the tab, but the script just ends because I don't know how to escape </script> (I tried '<'+'script/>' and things to no avail.)
Keep in mind the iframe I am including this in doesn't have <script> tags around it.
Thanks a lot guys!
if you load AJAX that contains a <script>, then inject that HTML into your DOM, the script you received will usually execute
someElementOnYourPage.innerHTML = ajaxRequest.responseText
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.