TimCodes.NET
TimCodes.NET

Reputation: 4699

Why does this AJAX request fail before it begins?

$.ajax("changeposition.aspx?id=1&pos=1", {
        success: function(){
          alert('success!');
       }
});

In chrome that code gives an error saying (failed) in the status code and undefined in the type column. The request does not reach the page as I've tried debugging but the page load event never fires. Any ideas? I am developing on localhost and this page is within an authenticated admin area.

UPDATE: screenshot:

enter image description here

Upvotes: 1

Views: 102

Answers (3)

Quentin
Quentin

Reputation: 943746

Some adblockers do keyword matching in JavaScript URIs. banners.js or some other factor may be triggering it.

Disable adblocking to test this.

Upvotes: 2

Vigrond
Vigrond

Reputation: 8198

Shouldn't it be $.ajax("/changeposition.aspx?id=1&pos=1", { ... ?

(with the forward slash)

Upvotes: 0

Peter Kiss
Peter Kiss

Reputation: 9329

$.ajax({
        url : "changeposition.aspx?id=1&pos=1",
        success: function(){
          alert('success!');
       }
});

Upvotes: 0

Related Questions