I already discussed briefly about jQuery GET before. Actually the jQuery GET also return a second parameter indicating the status of getting the file. Let’s see an example:
<head> <title>jQuery GET Status</title> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $("document").ready(function() { $.get('http://localhost/xampp/jquery/urls.txt', function(data, tStatus) { // Check if the result (data) can be passed back alert("The file contents is: " + data + "\n\n" + "The status is: " + tStatus); }); }); </script> </head> <body> <h2>jQuery GET Status</h2> </body> </html>
If the URL of the file is correct and everything is going well. The following result will be shown:
jQuery Example File:
Therefore the visitors will know that the process is going well.
Leave a Reply