Advertisement
Guest User

Untitled

a guest
Jan 13th, 2011
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2.     <head>
  3.         <script language="javascript" src="http://code.jquery.com/jquery-1.4.4.min.js">
  4.         </script>
  5.         <script language="javascript">
  6.        
  7.             /*
  8.              * Could anyone explain why 'status' is 'success' even if you connect
  9.              *   to an invalid address? What's the correct way of handling this sort of error?
  10.              */
  11.            
  12.             var INVALID_ADDRESS = "http://127.0.0.1:82/?"
  13.            
  14.             $(document).ready(function() {
  15.                 $('pre').append("Loading the invalid address '"+INVALID_ADDRESS+"'..");
  16.                 $.get(INVALID_ADDRESS, function(data,status) {
  17.                     $('pre').append("\nStatus: "+status);
  18.                     $('pre').append("\nData: "+data);
  19.                 });
  20.             });
  21.         </script>
  22.     </head>
  23.     <body>
  24. <pre>
  25. </pre>
  26.     </body>
  27. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement