我该如何分配的JavaScript变量PHP变量?随着出提交表单 [英] How do I assign javascript variable to php variable? With out submitting the form
本文介绍了我该如何分配的JavaScript变量PHP变量?随着出提交表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
喜的朋友可以有一个人告诉我,我该如何分配的JavaScript变量PHP变量? 我实际上得到的值通过JavaScript和我想的JavaScript值被分配到PHP变量。随着出提交表单。
hi friends can some one tell me How do I assign javascript variable to php variable? I am actually getting a value through javascript and I want the javascript values to be assigned to php variables. With out submitting the form.
推荐答案
使用jQuery选择这样做。或者使用一个隐藏的表单,如果你不希望用户看到它。
Use the jQuery selector to do that. OR use a hidden form if you don't want the user to see it.
例如,做到这一点。
<input type="hidden" name="YOUR_OWN_UNIQUE_NAME" id="UNIQUE_ID" value >
之后,只需使用jQuery选择
After that, just use jQuery selector
$("#UNIQUE_ID").val("VALUE")
这就是它,没有太大的问题!
That's about it, not much problems!
这篇关于我该如何分配的JavaScript变量PHP变量?随着出提交表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文