Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (window.XMLHttpRequest)
- {// code for IE7+, Firefox, Chrome, Opera, Safari
- xhr=new XMLHttpRequest();
- }
- else
- {// code for IE6, IE5
- xhr=new ActiveXObject("Microsoft.XMLHTTP");
- }
- $(function() {
- var url = "http://www.google.com";
- $.ajax(url,
- {
- error:function (xhr, ajaxOptions, thrownError){
- alert(xhr.status);
- switch (xhr.status) {
- case 404:
- // Desired Action.
- }
- }
- complete: function(xhr, statusText){
- alert(xhr.status);
- }
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement