I am trying to put a jQuery gallery after the Ajax call. On my main site, I create a div which wrap the main content (e.g site_content). When users click on one of the hyperlink on the main page, the “site_content” will get updated and display other content which is saved at other HTML file and I am using AJAX to avoid the whole page refresh. However I having a problem of running the JavaScript/jQuery gallery because the JavaScript won’t work after the AJAX call.
I understand that because the browser does not know there will be some functions to call after the content (from the other HTML file) is successfully displayed. I tried to use the jQuery getScript method but it is still not working.
Could anyone give me some ideas how can I run the javaScript/jQuery gallery after the AJAX call?
Thanks
In such circumstances you need to keep jQuery bind and live function in mind.
Just go through the tutorial try on to your ajax call and see the magic.
For eg.