Load a page using AJAX: responseText?

Apr 14, 2008 at 6:55 AM
Hi,

I have made a page something like dropthing project but not be cool as it :S. I used AJAX to load pages dynamically. Everything seems to be fined exception this situation:
- The page contains some javascript code( OOP in code) which means it contains some objects. Ex: var myObject = new MyObject("my name","age");
- If i used iframe to load the page, then it's ok. But i cannot use iframe in my project.
- The problem with using AJAX: responseText ( using: div.innerHTML = responseText;) is that the whole page is returned in Text format therefore the script above will be :var myObject = new MyObject(\"my name\",\"age\"); . It results that the script cannot be executed.
- The problem can be solved by putting the script into a seperated javascript file. But i used control from Infagistic thus the script is rendered dynamically in server code.

Does anyone know how to solve that problem? Please help.