【发布时间】:2014-10-29 21:20:03
【问题描述】:
<script type='text/javascript'>
$(window).load(function(){
$("body").click(function(){
var s = window.getSelection();
s.modify('extend','backward','word');
var b = s.toString();
s.modify('extend','forward','word');
var a = s.toString();
s.modify('move','forward','character');
var variablej=b+a; //variablej is Jquery Variable
//how to pass a Jquery variable to php variable
<?php $variablephp = "<script>document.write(variablej)</script>" ?> //variablephp is php variable
<?php $result = mysql_query("SELECT * FROM translate where English='$variablephp'"); ?>
</script>
【问题讨论】:
-
您可以通过
ajax进行操作 -
我怎么能。我现在不能。请让我们举一个简单的例子?
标签: javascript php jquery mysql