基于jQuery的Ajax技术中,edit(id)函数无法获得php中的变量值,求指点
<?@session_start();$user1=isset($_SESSION["userper"])?$_SESSION["userper"]:NULL;if(!$...
<?
@session_start();
$user1=isset($_SESSION["userper"])?$_SESSION["userper"]:NULL;
if(!$user1){echo"<script>window.location.href='../main/illegal.html';</script>";}
?>
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="../js.css/plus.css">
<title>简历操作</title>
<script src="../js.css/jquery-1.11.2.min.js"></script>
<script>
$(document).ready(function(){
function edit(id){
alert(id);
// $.post("persusnavi4plus.php",{id:id,sid:Math.random()},
// function(data){
// $("#back").html(data);});
// }
}
});
</script>
</head>
<body>
<div class="psnavi4">
<?
$connect=mysql_connect('localhost','root','ellis') or die("无法登陆数据库!");
mysql_select_db("ojrs", $connect);
mysql_query("set names 'utf8'");
echo"<h3>投递简历记录</h3>";
$mysql=mysql_query("select * from pte where appN='$user1' order by appD desc");
if(mysql_num_rows($mysql)==0){echo "您没有进行过任何简历的投送!也许您该积极点。";}
else{
echo"<table><tr><th>时间</th><th>岗位</th><th>公司</th><th>查看回复<th>删除记录</th></tr>";
while($row=mysql_fetch_array($mysql)){
echo"<tr><td>".$row[appD]."</td><td>".$row[tolike]."</td><td>".$row[toReN]."</td><td><a href='javascript:void(0);' onClick='edit(".$row[appN].")'>查看</a></td><td><a href='javascript:void(0);' onClick='edit(".$row[snumI].")'>删除</a></td></tr>";}
/* echo"<tr><td>".$row[appD]."</td><td>".$row[tolike]."</td><td>".$row[toReN]."</td><td><a href='javascript:void(0);' onClick='"."edit(".$row[appN].")"."'>查看</a></td><td><a href='javascript:void(0);' onClick='"."edit(".$row[snumI].")"."'>删除</a></td></tr>";}*/
echo"</table>";
}
?>
<div id="back"></div>
</div>
</body>
</html> 展开
@session_start();
$user1=isset($_SESSION["userper"])?$_SESSION["userper"]:NULL;
if(!$user1){echo"<script>window.location.href='../main/illegal.html';</script>";}
?>
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="../js.css/plus.css">
<title>简历操作</title>
<script src="../js.css/jquery-1.11.2.min.js"></script>
<script>
$(document).ready(function(){
function edit(id){
alert(id);
// $.post("persusnavi4plus.php",{id:id,sid:Math.random()},
// function(data){
// $("#back").html(data);});
// }
}
});
</script>
</head>
<body>
<div class="psnavi4">
<?
$connect=mysql_connect('localhost','root','ellis') or die("无法登陆数据库!");
mysql_select_db("ojrs", $connect);
mysql_query("set names 'utf8'");
echo"<h3>投递简历记录</h3>";
$mysql=mysql_query("select * from pte where appN='$user1' order by appD desc");
if(mysql_num_rows($mysql)==0){echo "您没有进行过任何简历的投送!也许您该积极点。";}
else{
echo"<table><tr><th>时间</th><th>岗位</th><th>公司</th><th>查看回复<th>删除记录</th></tr>";
while($row=mysql_fetch_array($mysql)){
echo"<tr><td>".$row[appD]."</td><td>".$row[tolike]."</td><td>".$row[toReN]."</td><td><a href='javascript:void(0);' onClick='edit(".$row[appN].")'>查看</a></td><td><a href='javascript:void(0);' onClick='edit(".$row[snumI].")'>删除</a></td></tr>";}
/* echo"<tr><td>".$row[appD]."</td><td>".$row[tolike]."</td><td>".$row[toReN]."</td><td><a href='javascript:void(0);' onClick='"."edit(".$row[appN].")"."'>查看</a></td><td><a href='javascript:void(0);' onClick='"."edit(".$row[snumI].")"."'>删除</a></td></tr>";}*/
echo"</table>";
}
?>
<div id="back"></div>
</div>
</body>
</html> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询