function al(){
var selr = jQuery('#grid').jqGrid('getGridParam','selrow');
if(selr){
<?
include_once("../../DB/singleton.php");
$pDatabase = Database::getInstance();
$c = $pDatabase->query("select c.city_title as 'City' from teamshuffle.tbl_city c, teamshuffle.tbl_sport_city s where c.tblcity_id = s.tblcity_id and s.tblsport_id = " .);
while($r = mysql_fetch_array($c)){
echo("alert(\"" . $r[0] . selr . "\");");
}
?>
}
}
這是我的javascript函數。我需要訪問該行中的變量「selr」如何使用php代碼訪問javascript變量
echo("alert(\"" . $r[0] . $d . "\");");
嚴......服務器端VS客戶端。你不能使用阿賈克斯;當JS執行時,php早就結束了它的工作 – 2011-12-21 13:58:49