我有一个脚本,可以从表单提交中收集数据。如果数据正确验证,它会创建一个数据字符串并将其发布到另一个URL(这是一个wordpress页面),该URL收集数据并将数据插入posts表中。
当我手动加载时,Wordpress URL工作正常,但是当我通过ajax发布数据时,我的控制台显示URL返回404但是当我卷曲URL时,它返回200 。
该网站目前位于内部登台网址上,因此我无法提供任何实际网址。
任何帮助都会很棒。
控制台错误:
Failed to load resource: the server responded with a status of 404 (Not Found)
ajax代码:
submissionURL = "http://staging.ccc.site.edu.au/process/"
jQuery.ajax({
type : "POST",
url : submissionURL,
data : dataString,
success : function() {
jQuery('form#enquiry_form_main').hide();
jQuery('.enquiryMessage').html("<div id='SubmitMessage'></div>");
jQuery('#SubmitMessage').html('<h3>Thank you for your enquiry</h3><p>One of our Staff managers will respond to your enquiry as soon as possible. </p><p>A copy of your request will be sent to your email address, along with any reply email. If you do not receive these please ensure you check your junk box. </p>').hide().fadeIn(1500, function() {
jQuery('#message');
});
}
});
控制台卷曲结果
HTTP/1.1 200 OK
Date: Thu, 29 May 2014 01:48:29 GMT
Server: Apache/2.2.22 (Ubuntu)
X-Powered-By: PHP/5.3.10-1ubuntu3.8
X-Pingback: http://staging.ccc.site.edu.au/xmlrpc.php
Link: <http://staging.ccc.site.edu.au/?p=680>; rel=shortlink
Vary: Accept-Encoding
Content-Type: text/html; charset=UTF-8