-1
我有以下jQuery代码将数据发布到php文件,并在本地主机上正常工作。但是,当此代码现在在服务器上时,脚本将返回错误而不是数据。Jquery Ajax没有在服务器上工作,但在本地主机上工作
$.ajax({
type: 'POST',
url: 'scripts/info.php',
data: {
accountNumber: accountNumber,
agentName: name
},
success: function(data) {
alert(data)
},
error: function(xhr, status, error) {
// check status && error
alert(status)
}
});
这是在处理POST请求的PHP文件中的代码:
$args0 = array(
'accountNumber' => $_POST['accountNumber'],
'dateReceived' => date("Y-m-d"),
'firstNames' => $_POST['agentName'] '
'regNumber' => $_POST['accountNumber'],
'surname' => $_POST['agentName']
);
try {
$client = new SoapClient(WSDL_URL, array(
'trace' => 1,
'exceptions' => true,
'connection_timeout' => 300));
$params = array(
'arg0' => $args0,
);
$client->__setLocation(WSDL_LOCATION);
$response = $client->upload($params);
$response = $client->__getLastResponse();
echo $response;
请帮
什么是控制台错误? – Perspective
没有控制台错误 – Deant
我一直在寻找解决方案,但我找不到任何解决方案 – Deant