Electronics - Find jobs - Debt Consolidation - Wordpress Themes - Debt Consolidation

PDA

View Full Version : Passing Javascript code in an XMLHttp Request


quaffapint
Feb 13th 2007, 9:25 am
I'm trying to determine the best way to pass javascript code that includes a link to a different javascript file through an xmlhttp request.

For example, say I want to pass...

<script>
stuff
</script>
<script src="http://someserver.com/somescript.js></script>

...How would I pass that and execute it. Would an 'eval' be appropriate for this?

Thanks for any thoughts...:)

ajsa52
Feb 13th 2007, 11:44 am
Maybe with Ajax.Updater function from prototype.js library.
Try using url=http://someserver.com/somescript.js, and adding evalScripts:true to the list of properties in the last argument of the object constructor.

quaffapint
Feb 13th 2007, 5:02 pm
I'll check into it - thanks...

quaffapint
Feb 13th 2007, 8:20 pm
Bummer doesnt look like it will work with a remote javascript src...