JavaScript Evaluation on AJAX loaded page
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jessey_Erath
Posted On:   Tuesday, May 30, 2006 12:28 PM


I am using AJAX to retrieve some data and within the formatting of that data, I execute a JavaScript function. I'm using prototype.js and I have evalScript set to true, but nothing happens. I think that the way I have the JS on the php page being loaded is incorrect. It looks like this:


			
echo "
";



Could you please tell me how this script should look?


Thank you,

Jessey

Re: JavaScript Evaluation on AJAX loaded page

Posted By:   Anonymous  
Posted On:   Tuesday, June 6, 2006 07:21 AM

When You are loading data using Ajax if the loaded data has any inline Scripts they does'nt get executed.This is because we are actually not loading the page , we just do a innerHTML and put the response as a string.
So there is nothing wrong with your code.It is only that if you want that function to get called then you have to put that function call in the callback method of the XMLHttpRequest.
About | Sitemap | Contact