我如何使用jQuery / Javascript POST变量到另一个页面
How do I POST variables using jQuery / Javascript to another page?
我如何使用POST使用jQuery/Javascript发送到另一个页面并重定向到该页面?
使用GET发送变量
在Javascriptwindow.location = 'receivepage.php?variable='+testVariable;
当它被PHP接收时…
$var = $_GET['variable'];
我怎么做^,使用$_POST?
I already tried…
$.post(
'receivepage.php', {
i: i
}, function(){
window.location = 'receivepage.php';
}
);
但是当它到达PHP
Doing $。post试图通过ajax发布信息,然后重定向到您的页面,所以当您最终到达那里时,属性"i"将不会被接收。
你可以这样做: