【发布时间】:2014-09-04 11:41:30
【问题描述】:
我的 javascript 文件中有如下 ajax 代码:
// Default settings for Ajax requests
$.ajaxSetup({
type: 'POST',
url: path + '/relay.php'+ '?curr=' + currency + "&ver=" + Math.random(),
success: function(response) {
// Refresh the cart display after a successful Ajax request
container.html(response);
$('#jcart-buttons').remove();
},
.......
以上将发布为(在萤火虫中):
POST http://www.myshop.com/cart/relay.php?curr=EUR&ver=0.5750630930208085
我有一个删除功能如下:
function remove(link) {
// Get the query string of the link that was clicked
var queryString = link.attr('href');
queryString = queryString.split('=');
// The id of the item to remove
var removeId = queryString[1];
// Remove the item and refresh cart display
$.ajax({
type: 'GET',
data: {
"jcartRemove": removeId,
"jcartIsCheckout": isCheckout
}
});
}
remove 会显示如下(firebug)
GET http://www.myshop.com/cart/relay.php?curr=EUR&ver=0.5750630&jcartRemove=5
我也需要删除 curr 变量...
我怎样才能在上面的删除链接代码中做到这一点???
【问题讨论】:
-
如果要删除它,为什么要添加它? NOT 将其放入您的
relay.php脚本中开始使用不是更容易吗? -
@Marc B 我需要将 curr 变量传递到另一个页面..
标签: javascript php jquery ajax post