http://drupal.org/project/ajax_comments
AJAX Comments
View
CVS instructions
Modules · Content display
neochief - December 18, 2008 - 12:44
One of the most wanted Drupal modules :)
Module is now depends on Comments bonus API!
Features in 6.x:
Provides ajax comments to drupal sites. Features:
- Makes AJAX submits
- Allows to reply comments on the actual thread page
- AJAX comments deleting
- Works with CAPTCHA
- Cool jquery sliding
Comming soon:
- AJAX pagination
- Thread folding
- AJAX deleting and moderation approval
- AJAX editing
Please, read README.TXT file before installation to avoid troubles.
If you're using FCKeditor, you should upgrade to 2.x, to be able to use ajax comments (FCKeditor ......
AJAXÎÞÒÉÊÇ2005Äê³´µÄ×îÈȵÄWeb¿ª·¢¼¼ÊõÖ®Ò»£¬µ±È»£¬Õâ¸ö¹¦ÀÍÀë²»¿ªGoogle¡£ÎÒÖ»ÊÇÒ»¸öÆÕͨ¿ª·¢Õߣ¬Ê¹ÓÃAJAXµÄµØ·½²»ÊÇÌرð¶à£¬ÎҾͼòµ¥µÄ°ÑÎÒʹÓõÄÐĵÃ˵һÏ¡££¨±¾ÎļÙÉèÓû§ÒѾ¾ßÓÐJavaScript¡¢HTML¡¢CSSµÈ»ù±¾µÄWeb¿ª·¢ÄÜÁ¦£©
¡¡¡¡[AJAX½éÉÜ]
¡¡¡¡AjaxÊÇʹÓÿͻ§¶Ë½Å±¾ÓëWeb·þÎñÆ÷½»»»Êý¾ÝµÄWebÓ¦Óÿª·¢·½·¨¡£WebÒ³Ãæ²»Óôò¶Ï½»»¥Á÷³Ì½øÐÐÖØмӲ㬾ͿÉÒÔ¶¯Ì¬µØ¸üС£Ê¹ÓÃAjax£¬Óû§¿ÉÒÔ´´½¨½Ó½ü±¾µØ×ÀÃæÓ¦ÓõÄÖ±½Ó¡¢¸ß¿ÉÓᢸü·á¸»¡¢¸ü¶¯Ì¬µÄWebÓû§½çÃæ¡£
¡¡¡¡Òì²½JavaScriptºÍXML£¨AJAX£©²»ÊÇʲôм¼Êõ£¬¶øÊÇʹÓü¸ÖÖÏÖÓм¼Êõ——°üÀ¨¼¶ÁªÑùʽ±í£¨CSS£©¡¢JavaScript¡¢XHTML¡¢XMLºÍ¿ÉÀ©Õ¹ÑùʽÓïÑÔת»»£¨XSLT£©£¬¿ª·¢Íâ¹Û¼°²Ù×÷ÀàËÆ×ÀÃæÈí¼þµÄWebÓ¦ÓÃÈí¼þ¡£
¡¡¡¡[AJAXÖ´ÐÐÔÀí]
¡¡¡¡Ò»¸öAjax½»»¥´ÓÒ»¸ö³ÆΪXMLHttpRequestµÄJavaScript¶ÔÏó¿ªÊ¼¡£ÈçͬÃû×ÖËù°µÊ¾µÄ£¬ËüÔÊÐíÒ»¸ö¿Í»§¶Ë½Å±¾À´Ö´ÐÐHTTPÇëÇ󣬲¢ÇÒ½«»á½âÎöÒ»¸öXML¸ñʽµÄ·þÎñÆ÷ÏìÓ¦¡£Ajax´¦Àí¹ý³ÌÖеĵÚÒ»²½ÊÇ´´½¨Ò»¸öXMLHttpRequestʵÀý¡£Ê¹ÓÃHTTP·½·¨£¨GET»òPOST£©À´´¦ÀíÇëÇ󣬲¢½«Ä¿±êURLÉèÖõ½XMLHttpRequest¶ÔÏóÉÏ¡£
¡¡¡¡µ±Äã·¢ËÍHTTPÇëÇó£¬Ä㲻ϣÍûä¯ÀÀÆ÷¹ÒÆ𲢵ȴý·þÎñÆ÷µÄÏ ......
Õ⼸ÌìÒ»Ö±ÔÚÑо¿treeTable£¨ÊÇÒ»¿îjQueryµÄ²å¼þ£©£¬Õâ¿î²å¼þ½«ÆÕͨµÄ±í£¬±ä³ÉÒ»¸ö¿ÉÒÔÊÕËõµÄtreeTable¡£ÕâÖÖ±í¸ñÖ÷ÒªÓ¦ÓÃÓÚȨÏÞ´¦Àí£¬¿ÉÒÔʹÓû§Ò»Ä¿ÁËÈ»µØ¿´¼û¸÷¸ö×ÊÔ´µÄ¼Ì³Ð¹Øϵ¡£ ÉÏͼ¾ÍÊÇÒ»¸ö¼òµ¥µÄtreeTableͼÀý¡£ µ«ÊǸñíÊÇÒ»¸ö¾²Ì¬µÄ±í£¬±í¸ñÀïµÄÄÚÈÝÊÇÒ»´ÎÐÔ´Ó·þÎñÆ÷ÉÏ»ñÈ¡ÏÂÀ´£¬È»ºó²å¼þ¸ù¾ÝtrµÄidÒÔ¼°class¹¹½¨tableµÄ²ã¼¶¹Øϵ¡£ÎÒµÄtrÒÔ¼°tdµÄhtml´úÂëÊdzÌÐò¶¯Ì¬Éú³ÉµÄ£¬È»ºóÊä³öÔÚÒ³ÃæÉÏ£¬Ò³Ãæ¼ÓÔØÍê³Éºó£¬ÀûÓÃjQuery¸ø±í¸ñµÄÿһÁÐÔö¼ÓÒ»¸öclickʼþ£¬ÓÃÀ´Êó±êµã»÷±ä»»Í¼Æ¬¡£ µ«ÊÇÓеÄʱºò±í¸ñ»áºÜ´ó£¬Ò»¸ö·ÖÖ§ÏÂÓкܶà×Ó·ÖÖ§£¬Õâʱ¼ÓÔرí¸ñ¾ÍÐèÒªºÄ·ÑһЩʱ¼äÁË£¬¶ø×ÓĿ¼µÄ¶¯Ì¬¼ÓÔØÄܷܺ½±ãµÄ»º½âÕâÖÖѹÁ¦¡£ÒòΪtreeTable²å¼þ²»Ö§³ÖAjax£¬ËùÒÔ×Ô¼º¶¯ÊÖÀ©Õ¹Ajax¹¦ÄÜ£¬Ò³ÃæÖ»¼ÓÔصÚÒ»¼¶µÄ·ÖÖ§£¬Í¨¹ýAjax¶¯Ì¬¼ÓÔØ×Ó·ÖÖ§¡£Ë¼Â·È·¶¨ÒԺ󰳾ͿªÊ¼¡°ÆðÁ¢ßÇàꡱµØÕû´úÂ룬1СʱºótreeTable¸ÄÔìÍê³É£¬Êó±êµã»÷·ÖÖ§£¬¶¯Ì¬È¥Êý¾Ý¿â¶ÁÈ¡×Ó·ÖÖ§µÄÊý¾Ý¡£ÐÄÀﻹͦÃÀµÄ£¬µ«ÊÇͻȻ·¢ÏÖÒ»¸öÎÊÌ⣺ ÎÒÒ³ÃæÉϵÄclickʼþ³öÏÖÎÊÌâÁË£¬Ð¼ÓÔØÉÏÈ¥µÄ×Ó·ÖÖ§£¬µã»÷ͼƬ²»»á·¢Éú±ä»»¡£²é¿´Ò³Ãæjs·½·¨£¬·¢ÏÖclickµÄ·½·¨ÊÇÔÚÒ³Ãæ¼ÓÔØÍê³Éºó½øÐÐÉèÖõģ¬¶ ......
Ò»¡¢XMLHttpRequest ¶ÔÏóµÄ·½·¨ÓëÊôÐÔ
·½ ·¨
Ãè Êö
abort()
Í£Ö¹µ±Ç°ÇëÇó
getAllResponseHeaders()
°ÑHTTPÇëÇóµÄËùÓÐÏìÓ¦Êײ¿×÷Ϊ¼ü/Öµ¶Ô·µ»Ø
getResponseHeader("header")
·µ»ØÖ¸¶¨Êײ¿µÄ´®Öµ
open("method", "url")
½¨Á¢¶Ô·þÎñÆ÷µÄµ÷Óá£method²ÎÊý¿ÉÒÔÊÇGET¡¢POST»òPUT¡£url²ÎÊý¿ÉÒÔÊÇÏà¶ÔURL»ò¾ø¶ÔURL¡£Õâ¸ö·½·¨»¹°üÀ¨3¸ö¿ÉÑ¡µÄ²ÎÊý
send(content)
Ïò·þÎñÆ÷·¢ËÍÇëÇó
setRequestHeader("header", "value")
°ÑÖ¸¶¨Êײ¿ÉèÖÃΪËùÌṩµÄÖµ¡£ÔÚÉèÖÃÈκÎÊײ¿Ö®Ç°±ØÐëÏȵ÷ÓÃopen()
Êô ÐÔ
Ãè Êö
onreadystatechange
ÿ¸ö״̬¸Ä±äʱ¶¼»á´¥·¢Õâ¸öʼþ´¦ÀíÆ÷£¬Í¨³£»áµ÷ÓÃÒ»¸öJavaScriptº¯Êý
readyState
ÇëÇóµÄ״̬¡£ÓÐ5¸ö¿ÉÈ¡Öµ£º0 = δ³õʼ»¯£¬1 = ÕýÔÚ¼ÓÔØ£¬2 = ÒѼÓÔØ£¬3 = ½»»¥ÖУ¬4 = Íê³É
responseText
·þÎñÆ÷µÄÏìÓ¦£¬±íʾΪһ¸ö´®
responseXML
·þÎñÆ÷µÄÏìÓ¦£¬±íʾΪXML¡£Õâ¸ö¶ÔÏó¿ÉÒÔ½âÎöΪһ¸öDOM¶ÔÏó
status
·þÎñÆ÷µÄHTTP״̬Â루200¶ÔÓ¦OK£¬404¶ÔÓ¦Not Found£¨Î´ÕÒµ½£©£¬µÈµÈ£©
statusText
HTTP״̬ÂëµÄÏàÓ¦Îı¾£¨OK»òNot Found£¨Î´ÕÒµ½£©µÈµÈ£©
¶þ¡¢Ê¹ÓÃXMLHttpReq ......
Ò» .ÏÂÃæÏȶÔasp.net ajax×öÒ»¸ö¼òµ¥µÄ½éÉÜ:
asp.net ajax µÄ Ç°Éí¾ÍÊÇÎÒÃÇ´ó¼ÒÊìϤµÄAtlas £¬ºóÀ´±»ÕýʽµÄÄÉÈëµ½vs¿ò¼ÜÖÐÀ´¡£Í¨¹ý¶Ôasp.net ajaxµÄÓ¦Óà £¬ÎÒÃÇ¿ÉÒÔ·½±ãµÄ½«ajaxµÄÌØÐÔÒýÈëµ½ÏîÄ¿ÖÐÀ´£¬ÏÔÖøµÄÌá¸ßÓû§ÌåÑé¡£Æäʵasp.net ajaxµÄÌصãÒ²ÊǼ̳ÐÁË΢Èí²úÆ·Ò»¹áµÄÌص㣬¼òµ¥Ò×Ó᣹¦ÄÜÇ¿´ó¡£Ö»ÐèÒªÕÆÎÕasp.net ajaxµÄ¼¸¸ö¹Ø¼ü¿Ø¼þ£¬¾Í¿ÉÒÔÓ¦Óõ½ÏîÄ¿ÖÐÀ´ÁË¡£ ÏÂÃæ¼òµ¥µÄ½éÉÜÒ»ÏÂasp.net ajaxµÄ¼¸¸ö¹Ø¼ü¿Ø¼þ£º
1 ScriptManager£º ScriptManager¿Ø¼þËãÊÇasp.net ajax ¿Ø¼þÖÐ×îÖØÒªµÄÒ»¸öÁË£¬ËùÓеĽű¾¶¼ÊÇͨ¹ýScriptManagerÀ´¹ÜÀíµÄ £¬ËüµÄʹÓÃÒò¸Ã×¢ÒâÒÔϼ¸µã£º a ÔÚÒ»¸öÒ³ÃæÖУ¬ÓÐÇÒÖ»ÄÜÓÐÒ»¸öScriptManager¿Ø¼þ£¬¶øÇÒÒò¸Ã½«Ëü×÷ΪҳÃæµÄµÚÒ»¸ö¿Ø¼þ£¨·ñÔòÈÝÒ×±¨ÄªÃûµÄÒì³£ sys.ʲôʲôµÄ¡££©×÷Ϊasp.net µÄºËÐĿؼþ£¬Ëü¶Ôajax¿Ø¼þÖÐÓõ½µÄ½Å±¾×÷ͳһµÄµ÷¶È¹ÜÀí¡£Òò´Ë£¬Ò»Ð©ÊôÐÔµÄÉèÖÃÒ²ÖÁ¹ØÖØÒª£¬AsyncPostBackTimeout Õâ¸öÊôÐÔ¾ö¶¨ÁËÒì²½ÇëÇóµÄʱ¼äÏÞÖÆ£¬Èç¹ûÄãÓбȽϸ´ÔÓµÄÒì²½ÇëÇóµ÷Ó㬾ÍÐèÒª½«Õâ¸öÊôÐÔµÄÖµÉèÖõĴóһЩ£¬·ñÔò¾ÍСһЩ£¬Ä¬ÈÏÊÇ90ºÁÃë¡£AsyncPostBackError ÊǸöʼþ´úÀí£¬µ±Ò³ÃæÖеÄÒì²½ÇëÇóµ ......
var xmlHttp;
function createXMLHttpRequestss() {
if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}else if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
}
function startRequest(){
var projectName = document.getElementById("pronameid").value;
var alarmName = document.getElementById("alarmNameId").value;
var url = "getAgentNo.action?randcount="+Math.random()+"&code="+document.getElementById("selectId").value+"&alarmName="+alarmName+"&projectName="+projectName+"&skillName="+document.getElementById("skillGroupId").value;
c ......