0

Hi everybody I want to know is it possible to do this ? First I use $.post to post data to a href . when post done it will have data on it (this do not have href) and then i want to send another data on it but I don't know what is its href. For example :

$.post("/link", {
   "action" : "add_points_for_user",
   "search_user" : "data",
   "submit_search_user" :"Ok"
}, function(z) {
   console.log(z);
   // I want to send another data on it (use $.post) without using url 
});
4

2 回答 2

1
If it is possible or not

不可以。没有任何 url 是不可能发布数据的。如果您不想将其发送到其他地方,那又有什么意义呢?然后你可以只拥有变量并在任何你想要的地方使用它们,而不是发布它。正确的?您将数据保存为变量。

 then i want to send another data on it but I don't know what is its href,

您始终可以拥有一个将传递url到此页面的变量,然后使用此变量url发布到此 url,

$.post(url, {
"action" : "add_points_for_user",
"search_user" : "data",
"submit_search_user" :"Ok"
}, function(z) {
console.log(z);
// I want to send another data on it (use $.post) without using url 
});
于 2013-07-25T06:05:08.413 回答
0

插入location.href

$.post(location.href, {
   "action" : "add_points_for_user",
   "search_user" : "data",
   "submit_search_user" :"Ok"
}, function(z) {
   console.log(z);
   // I want to send another data on it (use $.post) without using url 
});
于 2013-07-25T09:04:42.933 回答