I have implemented a bit of AJAX functionality using XMLhttpRequest, where it replaces a div and functions as expected.
However, I am facing difficulty in getting the JavaScript code in the included AJAX page to execute. Is there a way to run JavaScript from the AJAX page that is included?
For example, let's say mainpage.php contains a select form. Upon a change event in the select form, includepage.php is loaded into a div on the page and updates based on the selected option. While this setup works smoothly using xmlhttp, the challenge lies in executing JavaScript from the included page, such as displaying a simple alert box.
Unfortunately, I don't have any specific code to share, and I'm unsure if this is a standard behavior. I have searched for information on this but haven't found much help. Any guidance on how to run JavaScript from within an included AJAX page that replaces a div would be greatly appreciated.