jQuery¼¼Êõ

»ùÓÚjQueryµÄAjax¼¼ÊõÖУ¬edit£¨id£©º¯ÊýÎÞ·¨»ñµÃphpÖеıäÁ¿Öµ

×ÖºÅ+ ×÷ÕߣºH5Ö®¼Ò À´Ô´£ºH5Ö®¼Ò 2015-09-20 15:46 ÎÒÒªÆÀÂÛ( )

»ùÓÚjQueryµÄAjax¼¼ÊõÖУ¬edit£¨id£©º¯ÊýÎÞ·¨»ñµÃphpÖеıäÁ¿Öµ£¬ÇóÖ¸µãfunction edit(id) ²»ÐèÒª·ÅÔÚ$.ready() ÖÐ

»ùÓÚjQueryµÄAjax¼¼ÊõÖУ¬edit£¨id£©º¯ÊýÎÞ·¨»ñµÃphpÖеıäÁ¿Öµ£¬ÇóÖ¸µã <?
@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>

·ÖÏíµ½£º

¡¡

1.±¾Õ¾×ñÑ­ÐÐÒµ¹æ·¶£¬ÈκÎתÔصĸå¼þ¶¼»áÃ÷È·±ê×¢×÷ÕߺÍÀ´Ô´£»2.±¾Õ¾µÄÔ­´´ÎÄÕ£¬ÇëתÔØʱÎñ±Ø×¢Ã÷ÎÄÕÂ×÷ÕߺÍÀ´Ô´£¬²»×ðÖØÔ­´´µÄÐÐΪÎÒÃǽ«×·¾¿ÔðÈΣ»3.×÷ÕßͶ¸å¿ÉÄܻᾭÎÒÃDZ༭Ð޸Ļò²¹³ä¡£

Ïà¹ØÎÄÕÂ
  • 7¸öÓÐÓõÄjQueryС¼¼ÇÉ

    7¸öÓÐÓõÄjQueryС¼¼ÇÉ

    2016-02-26 13:02

  • jQueryÖÆ×÷selectË«ÏòÑ¡ÔñÁбí

    jQueryÖÆ×÷selectË«ÏòÑ¡ÔñÁбí

    2016-02-26 11:00

  • È«ÃæÏêϸµÄjQuery³£¼û¿ª·¢¼¼ÇÉÊÖ²á

    È«ÃæÏêϸµÄjQuery³£¼û¿ª·¢¼¼ÇÉÊÖ²á

    2016-02-26 10:02

  • Ç¿´óµÄjQueryÒƶ¯²å¼þTop 10

    Ç¿´óµÄjQueryÒƶ¯²å¼þTop 10

    2016-02-25 09:05

ÍøÓѵãÆÀ
î