当前位置: 动力学知识库 > 问答 > 编程问答 >

Jquery ajax json and sending over window.location.href?

问题描述:

I get a parser error thrown from this ajax call...

var pageURL = document.location.href;

var hotlinkName = $('#hotlinkName').val();

if (hotlinkName.length > 0) {

$.ajax({

data: {

hotlinkName: hotlinkName,

hotlinkURL: pageURL

},

success: function() {

alert('Your hotlink ' + hotlinkName + ' has been inserted to the url: ' + pageURL);

},

error: function (ajaxOptions, thrownError) {

alert(thrownError);

alert('Var hotlinkName: ' + hotlinkName + ' Var hotlinkURL: ' + pageURL);

}

});

}

As you can see in the error I alert the variables I am trying to send and they are as follows:

Var hotlinkName: Testing

Var hotlinkURL: http://www.example.com/home

分享给朋友:
您可能感兴趣的文章:
随机阅读: