我将以下 Post 请求发送到远程 apache 服务器,托管一个小型 php 脚本:
邮政:
var request = $.ajax({
type: 'POST',
url: 'http://my.server.on.port/mmm.php',
data: { abc: "abcdefghijklmnopqrstuvwxyz" } })
.done(function(data) { alert("success :"+data.slice(0, 100)); });
request.fail(function(jqXHR, textStatus) {
alert( "Request failed: " + request.reponseText + " " + request.status +" " + request.statusText +" " +request.responseText );
});
mmm.php 脚本:
<?php echo json_encode(array("first"=>"XXXXX","last"=>"YYYYY")); ?>
httpd.conf:
ServerName my.server.on.port
DocumentRoot "/var/www/html"
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
NameVirtualHost "my.server.on.port"
Listen 80
<VirtualHost *:80>
DocumentRoot "/var/www/html/QR/tst"
ServerName "my.server.on.port:80"
<Directory "/var/www/html/QR/tst">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory "/var/www/html/QR/tst/css/smoothness">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory "/var/www/html/QR/tst/development-bundle">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory "/var/www/html/QR/tst/development-bundle/ui">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory "/var/www/html/QR/tst/development-bundle/demos">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
来自服务器的回复是 304。所有文件都有 755 权限。没有 idia 如何解决这个问题。谢谢!
HTTP/1.1 304 Not Modified
Date: Sat, 21 Jul 2012 08:45:38 GMT
Server: Apache/2.2.22 (Fedora)
Connection: close
ETag: "c0744-f7a-4c553071e0d4e"
这是带有错误的警报: