Ajax content that contains internal javascript is not functioning

Put simply:

I have content coming in from an Ajax request. There are internal js variables being set on the page that don’t seem to be registering. As a matter of fact, as a test, I can’t even get an alert box to fire up. Though, when I run the page directly the alert triggers fine.

It’s obvious I’m misunderstanding some basic information about Ajax calls, haha. What am I missing?


The JavaScript on the page requested will not be executed. You will need to manually execute it once the page is retrieved via the AJAX call. If you are using JQuery the method html() does just that otherwise you can eval() the content yourself.

Awesome! I’ll give it a shot.