如何做一个购物网站,wordpress 增加按钮,wordpress 广告管理,网站系统设计方案我需要一些帮助#xff0c;我想知道如何将一个值从PHP变量传递给jquery脚本#xff1f;我正在做的是打开一个模式窗口#xff0c;从mysql浏览器创建的元素列表中#xff0c;所以我需要传递一个变量值的锚点。这是我的代码#xff1a;$query_tours Select * from to…我需要一些帮助我想知道如何将一个值从PHP变量传递给jquery脚本我正在做的是打开一个模式窗口从mysql浏览器创建的元素列表中所以我需要传递一个变量值的锚点。这是我的代码$query_tours Select * from tours where feautured Y ;$result_tours mysql_query($query_tours);while($rowmysql_fetch_array($result_tours )) {$tourID $row[recid];$tit_esp $row[tit_esp];$adrate $row[ad_rate];$chrate $row[ch_rate];echo ;print $tit_esp ;print Adultos : $adrate | Niños : $chrate ;print ver detalles;print ;}这里是jquery脚本$(function() {$( #dialog:ui-dialog ).dialog( destroy );var adult $( #adult ),child $( #chl ),fecha $(#datepicker),allFields $( [] ).add( adult ).add( child ).add( fecha ),tips $( .validateTips );function updateTips( t ) {tips.text( t ).addClass( ui-state-highlight );setTimeout(function() {tips.removeClass( ui-state-highlight, 1500 );}, 500 );}function checkLength( o, n, min, max ) {if ( o.val() max || o.val() min ) {o.addClass( ui-state-error );updateTips( El numero de n debes ser entre min y max . );return false;} else {return true;}}function checkFecha() {var dfecha document.getElementById(datepicker).value;if(dfecha ){//dfecha.addClass( ui-state-error );updateTips( Fecha Incorrecta);return false;}else{return true;}}function checkRegexp( o, regexp, n ) {if ( !( regexp.test( o.val() ) ) ) {o.addClass( ui-state-error );updateTips( n );return false;} else {return true;}}$( #dialog-form ).dialog({position: center,autoOpen: false,draggable: true,height: 300,width: 410,modal: true,show : {transitionIn: blind,transitionOut: explode,},open: function(event, ui) {$( #datepicker ).datepicker(enable);alert(regis)$.ajax({url: tour_cont.php,data: regis regis ,dataType: json,success: function(data){var titulo data[1];var user data[3];var comenta data[4];$( #dialog-form ).append( titulo );}});},buttons: {Agregar al Carrito: function() {var bValid true;bValid bValid checkFecha( datepicker );bValid bValid checkLength( adult, adultos, 1, 10 );bValid bValid checkLength( child, niños, 0, 10 );if ( bValid ) {$( #users tbody ).append( adult.val() child.val() fecha.val() );$( this ).dialog( close );}},Cancel: function() {$( this ).dialog( close );}},close: function() {allFields.val( ).removeClass( ui-state-error );$(#datepicker).datepicker(disable);}});$(a[class^myTour]).button().click(function() {$( #dialog-form ).dialog( open );});$( #create-chichen ).button().click(function() {$( #dialog-form ).dialog( open );});});希望有人能够低估我先进的谢谢