将值从Javascript传递给PHP [英] Pass values from Javascript to PHP
本文介绍了将值从Javascript传递给PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:
如何将JS变量传递给php?
如何将值从Javascript代码传递给PHP变量。
How can I pass value from Javascript code to PHP variables.
假设我们有这个:
aa = $("#amount").text($("#progressbar").progressbar("option", "value")+"%");
在< script>
标签中声明在Javascript中,我希望在PHP代码中获取或调用它。
declared in the <script>
tag of the Javascript, I want this to be fetch or called in the PHP code.
推荐答案
$.ajax({ url: 'test.php',
data: {action: 'aa'},
type: 'POST',
success: function(output) {
alert(output);
}
});
这篇关于将值从Javascript传递给PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文