【发布时间】:2017-09-20 10:38:34
【问题描述】:
【问题讨论】:
-
所以....使用 ajax?
-
你可以使用
$_SESSION -
不要认为php是正确的方法。为什么你不像 Manav 告诉你的那样使用 JS/jaax
标签: javascript php jquery wordpress
【问题讨论】:
$_SESSION
标签: javascript php jquery wordpress
搜索 ajax。例如(使用 jQuery)
$.ajax({ url: "website.com/phpfile.php?var=" + encodeURIComponent(value),
cache: false,
timeout: 10000,
success: function(response)
{
// do something with the result, or omit the whole success if not needed
},
error: function(jqXHR, textStatus, errorThrown)
{
// notify user about error?
}
});
有更简单、更有针对性的版本,例如 $.post 或 $.get 在这里查看:http://api.jquery.com/category/ajax/
【讨论】: