Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Jquery php µã»÷td±ä³Éinput£¬Ð޸ĺóʧȥ½¹µã·¢ËÍÊý¾Ý

html²¿·Ö
<Td><?php echo $row['bigclassid']?></Td>
<td height="25" width="241" class="bigclassname"><?php echo $row['bigclassname']?></a></td>
Js²¿·Ö
<script>
/**//*
* ˵Ã÷£ºÓÃJqueryµÄ·½·¨£¬ÎÞË¢ÐÂÒ³Ã棬±à¼­±í¸ñ
*/
$(function() {
//¸øÒ³ÃæÖÐÓÐbigclassnameÀàµÄ±êÇ©ÉϼÓÉÏclickº¯Êý
$(".bigclassname").click(function() {
var objTD = $(this);
//ÏȽ«ÀϵÄÀà±ðÃû³Æ±£´æÆðÀ´,²¢ÓÃtrim·½·¨È¥µô×óÓÒ¶àÓàµÄ¿Õ¸ñ
var oldText = $.trim(objTD.text());
//¹¹ÔìÒ»¸öinputµÄ±êÇ©¶ÔÏó£¨×÷ÓÃÊÇΪÁËÈÃÕâ¸öinputʧЧ£¬²»È»µã»÷¶à´Îºó£¬ÎÄ×Ö»áÏûʧ£©
var input = $("<input type='text' value='" + oldText + "' />");
//µ±Ç°tdµÄÄÚÈݱäΪÎı¾¿ò£¬²¢ÇÒ°ÑÀÏÀà±ðÃû·Å½øÈ¥
objTD.html(input);
//ÉèÖÃÎı¾¿òµÄµã»÷ʼþʧЧ
input.click(function() {
return false;
});
//ÉèÖÃÎı¾¿òÑùʽ£¬ÈýçÃæÏÔʾµÄÈËÐÔ»¯µã
input.css("font-size", "16px");
input.css("text-align", "center");
input.css("background-color", "#ffffff");
input.width("120px");
//×Ô¶¯Ñ¡ÖÐÎı¾¿òÖеÄÎÄ×Ö
input.select();
//Îı¾¿òʧȥ½¹µãʱÖØбäΪÎı¾
input.blur(function() {
//»ñµÃÐÂÊäÈëµÄÀà±ðÃû
var newText = $(this).val();
//ÓÃеÄÀà±ðÃûÎÄ×ÖÌ滻֮ǰ±ä¹ýÀ´µÄÊäÈë¿ò״̬
objTD.html(newText);
//»ñÈ¡¸ÃÀà±ðÃûËù¶ÔÓ¦µÄID(bigclassid)
var bigclassid = objTD.prev().text();
//½«ÐµÄÀà±ðÃû½øÐÐתÂ룬²»È»½çÃæÒÔ¼°Êý¾Ý¿âÏÔʾµÄ¶¼ÊÇ"???"ÕâÑùµÄÂÒÂë
newText = escape(newText);
//»ñÈ¡Òª´«µ½"Ò»°ã´¦ÀíÎļþ"(update_bigclassname_2.php)ÖеÄURL
var url = "update_bigclassname_2.php?bigclassid=" + bigclassid + "&bigclassname=" + newText;
//AJAXÒì²½¸ü¸ÄÊý¾Ý¿â,dataΪ³É¹¦ºóµÄ»Øµ÷·µ»ØÖµ£¬ÓÃÓÚÏÔʾÌáʾÐÅÏ¢
$.get(url, function(data) { alert(data) });
});
});
});
</script>
¸üÐÂÊý¾Ý¿âµÄ¹ý³Ì¾ÍÊÇÆÕͨµÄphp³ÌÐò
±¾ÀýÒªÓõ½jqueryÇë×ÔÐÐÏÂÔغóµ÷ÊÔ
Ô­ÎĵØÖ·:http://www.corange.cn/archives/2010/04/3576.html


Ïà¹ØÎĵµ£º

PHP³ÌÐòºÍMySqlÊý¾ÝÂÒÂëÎÊÌâÔ­Òò¼°½â¾ö

PHP³ÌÐòºÍMySqlÊý¾ÝÂÒÂëÎÊÌâÔ­Òò¼°½â¾ö
ÂÒÂëÎÊÌâ¼òµ¥Ëµ¾ÍÊÇÊý¾Ý¿âдÈë¶ÁÈ¡£¬ÍøÒ³Îļþ£¬ÍøÒ³ÏÔʾʱ¼¸¸ö»·½ÚµÄ±àÂë²»Ò»ÖÂÔì³ÉµÄ¡£
ÂÒÂëÎÊÌâ
дÈëʱ£ºÒ³ÃæÌáȡдÈëÊý¾Ý±àÂëºÍдÈëÊý¾Ý¿âʱ±àÂë²»Ò»ÖÂ
¶Áȡʱ£º¶ÁÈ¡ºóËùÓñàÂëÓëÊý¾Ý¿âдÈëʱ²»Ò»ÖÂ
ÏÔʾʱ£º±àÂëÓëÊý¾Ý¿â¶ÁÈ¡ºóµÄÊý¾Ý²»Ò»ÖÂ
ºÜÏÔȻֻÓÐÈýÕ߶¼Í³Ò»²ÅÐУ ......

PHPÖÐÎÄÂÒÂëµÄÈý¸öÔ­Òò¼°½â¾ö·½·¨


ÎÒÃÇÔÚ×öPHPÏîÄ¿µÄʱºò£¬¾­³£»áÓöµ½ÖÐÎÄÂÒÂëµÄÎÊÌ⣬ÓÐʱºò±àÂëÎÊÌ⻹µ¼ÖÂMYSQLµÄ±¨´í¡£ÖÐÎÄÂÒÂë×ܹ²ÓÐÈý¸öÔ­Òò
1£ºAPACHE·þÎñÆ÷ÉèÖõ¼ÖÂÂÒÂë
2£ºPHP£¬»òÕßHTMLÒ³Ãæ±àÂëµ¼ÖÂÖÐÎÄÂÒÂë
3£ºMYSQLÊý¾Ý¿âµÄ±íÒÔ¼°×ֶαàÂëµ¼ÖÂÖÐÎÄÂÒÂë
ÎÒÃÇ·Ö±ð´ÓÕâÈý¸ö²¿·ÖÀ´Ì½¾¿PHP³ÌÐòÉè¼ÆÖеıàÂëÎÊÌâ
ÔÚÕâ֮ǰÎÒÃÇÒªÁ˽âһЩ»ù±¾ÀíÂÛ ......

»ùÓÚPHPÍøÒ³¿ìÕÕÀà

<?PHP
//====================================================
//                FileName:        snap.class.php
//             ......

phpÖÐÅжÏ×Ô¶¨Òå·½·¨ÊÇ·ñ´æÔÚ

<?php
 
 
  function myFun(){
   echo "hello,ÕÅÈý";
  }
 
  //ÀûÓÃfunction_exists·½·¨ÅжÏ×Ô¶¯ÒÔ·½·¨ÊÇ·ñ´æÔÚ
  //¸Ã·½·¨²ÎÊýΪҪÅжϵÄ×Ô¶¨Òå·½·¨µÄ·½·¨Ãû£¬¿ÉдΪ
  //"myFun"»òmyFun
  if(function_exists(myFun)){
   echo "´æÔÚ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ