Edit Code in left box and click Show Results button to see the result. | Home
<html> <!-- Mirrored from www.tutorialspoint.com/cgi-bin/practice.cgi?file=jquery_122 by HTTrack Website Copier/3.x [XR&CO'2010], Thu, 01 Sep 2011 14:46:23 GMT --> <!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=UTF-8"><!-- /Added by HTTrack --> <head> <title>the title</title> <script type="text/javascript" src="../jquery/jquery-1.3.2.min.js"></script> <script type="text/javascript" language="javascript"> $(document).ready(function() { /* Global variable */ var count = 0; $("#driver").click(function(event){ $('#stage0').load('../jquery/result.html'); }); /* Gets called when request starts */ $("#stage1").ajaxStart(function(){ count++; $(this).html("<h1>Starts, Count :" + count + "</h1>"); }); /* Gets called when request is sent */ $("#stage2").ajaxSend(function(evt, req, set){ count++; $(this).html("<h1>Sends, Count :" + count + "</h1>"); $(this).append("<h1>URL :" + set.url + "</h1>"); }); /* Gets called when request complete */ $("#stage3").ajaxComplete(function(event,request,settings){ count++; $(this).html("<h1>Completes, Count :" + count + "</h1>"); }); }); </script> </head> <body> <p>Click on the button to load result.html file:</p> <div id="stage0" style="background-color:blue;"> STAGE - 0 </div> <div id="stage1" style="background-color:blue;"> STAGE - 1 </div> <div id="stage2" style="background-color:blue;"> STAGE - 2 </div> <div id="stage3" style="background-color:blue;"> STAGE - 3 </div> <input type="button" id="driver" value="Load Data" /> </body> <!-- Mirrored from www.tutorialspoint.com/cgi-bin/practice.cgi?file=jquery_122 by HTTrack Website Copier/3.x [XR&CO'2010], Thu, 01 Sep 2011 14:46:23 GMT --> <!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=UTF-8"><!-- /Added by HTTrack --> </html> |