If A Page Is Loaded Using Ajax From Php. How To Call A Function If Page Is Loaded
i'm working on php + ajax. can somebody help me in following process I made two divs (one contains manu, and other is target div, where pages are loaded from menu) i loaded a fr
Solution 1:
You would do it just like any standard AJAX:
set up the call back function for the AJAX success to check for any status code returned by the PHP code. If the status code is a success, then do what you want to -- in your case, call the Javascript function.
usually it is easier to use some Javascript library, such as jQuery's AJAX:
http://api.jquery.com/jQuery.ajax/
look for the success(data, textStatus, jqXHR)
which is the callback function and the examples there.
note that the status code 404 or 200 is different from your own status code. Your status code can be anything returned as the content of the AJAX call. Usually, a typical status code of 200 is returned, but that's the code for HTTP, not your status code.
Post a Comment for "If A Page Is Loaded Using Ajax From Php. How To Call A Function If Page Is Loaded"