jquery – 为什么我的POST变量出现在URL字符串上?

我已经基于按钮点击实现了ajax post功能.代码
$.ajax({
    type: "POST",url: "includes/PHPscripts?action=manage",data: {location: loc,lat: latitude,lon: longitude,heading: head,filename: file},success: function(){
      $("#panoInfo").html("<div id='message'></div>");
      $("#message").html("Valid Submission");
  }
});

我指定了POST方法,因为我不希望通过URL看到变量.但是,他们是.

我发布之前的测试网址是

http://localhost/JMCTour/buildtour.PHP

然后

http://localhost/JMCTour/buildtour.PHP?filename=1-prefix_blended_fused.jpg&location=Start+of+Tour&lat=43.682211&long=-70.450705&heading=100&submit=Save

为什么?

解决方法

docs for jQuery.ajax(强调我的):

data

Data to be sent to the server. It is converted to a query string,if not already a string. It’s appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array,jQuery serializes multiple values with same key based on the value of the traditional setting (described below).

因此:

processDataBoolean

Default: true

By default,data passed in to the data option as an object (technically,anything other than a string) will be processed and transformed into a query string,fitting to the default content-type “application/x-www-form-urlencoded”. If you want to send a DOMDocument,or other non-processed data,set this option to false.

相关文章

jQuery插件的种类 1、封装对象方法 这种插件是将对象方法封装起来,用于对通过选择器获取的jQuery对象进...
扩展jQuery插件和方法的作用是非常强大的,它可以节省大量开发时间。 入门 编写一个jQuery插件开始于给...
最近项目中需要实现3D图片层叠旋转木马切换的效果,于是用到了jquery.roundabout.js。 兼容性如图: ht...
一、什么是deferred对象? 开发网站的过程中,我们经常遇到某些耗时很长的javascript操作。其中,既有异...
AMD 模块 AMD(异步模块定义,Asynchronous Module Definition)格式总体的目标是为现在的开发者提供一...