简体   繁体   English

jQuery POST未被调用

[英]jQuery POST not being called

I have written a script that fires a jQuery POST to retrieve data from a server side file as JSON, the code is below: 我编写了一个脚本,该脚本触发一个jQuery POST以从服务器端文件中以JSON格式检索数据,代码如下:

$.post("myfile.php", function(authDataset) {
    alert(authDataset);
});

A sample of what would be returned is: 将返回的示例是:

{"firstName":"x","lastName":"y","boximg":"z"}

The handler file is working perfectly, when provided with the data the function all works fine, hoever the jquery POST function just isn't working. 处理程序文件运行正常,当提供数据时,该函数均正常运行,但是jquery POST函数不起作用。 I've also tried GET and AJAX. 我也尝试过GET和AJAX。

It is placed within the document.ready tag , I have ran every error checker including jsLint and jsFiddle but for some reason it's not firing at all. 它放置在document.ready标签中 ,我运行了所有错误检查器,包括jsLint和jsFiddle,但是由于某种原因,它根本没有触发。

I've used alerts inside and outside the post function, but the post() isn't getting called. 我已经在post函数的内部和外部使用了警报,但是未调用post()。

Can anyone offer a suggestion? 谁能提供建议? Thanks 谢谢

服务器上的HTACCESS文件正在强制使用SSL,这违反了同源起点策略。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM