我有一个表单输出一行简单的HTML <a href="link">A LINK</a>
我可以使用附加到网址的数据直接访问该流程,例如http://site.com/form.asp?sample=100
因为这是跨域(到子域),我试图使用JSONP.我首先尝试使用数据类型json,但我仍然得到403禁止.这是我正在尝试使用JSONP,但这是各种混乱,并返回错误与此%5Bobject%20Object%5D"附加到它.我想这是一个问题我如何尝试将数据附加到网址?
$j.getJSON({
type: 'POST',
url: 'http://site.com/form.asp',
data: 'order=' + ordervalue,
contentType: "application/json; charset=utf-8",
dataType: "jsonp",
success: function(response) {
alert(response);
}
});
Run Code Online (Sandbox Code Playgroud)