ASYNCHRONOUS JAVASCRIPT AND XML
JS²ã
// ¶¨ÒåÒ»¸öÈ«¾Ö
var xmlHttp;
// ·µ»ØÒ»¸öxmlHttpRequest¶ÔÏó
function createXMLHttpRequest() {
if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
} else {
if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
// ÔÚ¶¯×÷´¥·¢µãµ÷Óô˷½·¨£¬Òª´«²Î
function searchBwd(dirid){
var id = dirid;
createXMLHttpRequest();
if (xmlHttp) {
// ÉèÖÃurl·¾¶¡£Ö´ÐÐJAVA²ã·½·¨µÄ·¾¶¡£Èç´ø²Î£¬URLÖеÄ&²ÎÊýΪÆäÒ³ÃæÏà¹ØFORM BEANÖеÄ×ֶΣ¬ÈçÏÂÃæµÄ“singledirid”¡£
var url = "addBWDVocAction.do?actionType=GetDirBwd&singledirid=" + id;
// Òì²½¸üÐÂ
xmlHttp.open("POST", url, true);
xmlHttp.onreadystatechange = callback;// ´Ë·½·¨ÔÚÏÂÃæ¡£
xmlHttp.send();
} else {
alert("Can not create the request,please check your browser!!");
}
}
function callback() {
if (xmlHttp.readyState == 4) {
if (xmlHttp.status == 200) {
setBwdValue();// ´Ë´¦¿ªÊ¼Ö´ÐÐÔÚÒ³ÃæÉÏ»Êý¾ÝÁбíµÄ·½·¨
// ÈçÀàËÆÓÚÏÈ´æ´¢£¬ÔÙ²éѯչÏÖнá¹ûʱ£¬ÔÚ´Ëcallback·½·¨´¦ÔÙÒýÈë²éѯ·½·¨
} else {
window.location = "admin_addbwd.jsp";// Ö¸¶¨½á¹ûÒ³Ãæ
}
}
}
// Ò³ÃæÉÏ»Êý¾ÝÁбí
function setBwdValue() {
// ÏÂÃæÕⶨÒåÈý¸ö±äÁ¿£¬ÔÚÆäºóµÄFORÑ»·ÀïÈ¡Öµ£¬À´Ô´ÊÇJAVA²ã£¨ÈçSTRUTSÀïµÄACTION£©Êä³öµÄXMLÁ÷£¬ºóÃæ¸ø³ö¡£
var bwdid;
var bwdName_zh;
var bwdName;
var xmlDoc = xmlHttp.responseXML;
var root = xmlDoc.getElementsByTagName("xml").item(0);
for (var i = 0; i < root.childNodes.length; i++) {
var child = root.childNodes[i].childNodes;
// ÏÂÃæ¸øÒÔÉÏÈý¸ö×Ô¶¨ÒåµÄ±äÁ¿¸³Öµ£º
bwdid = child[0].firstChild.nodeValue;
bwdName_zh = child[1].firstChild.nodeValue;
bwdName = child[2].firstChild.nodeValue;
// ÏÈÅжÏÈý¸ö±äÁ¿ÀïµÄÖµÊÇ·ñΪ¿Õ
if (bwdid != "" && bwdName_zh != "" && bwdName != "") {
//Ìí¼ÓÒ»ÐÐ
var newTr = dirbwdTbl.insertRow();
//Ìí¼ÓÒ»ÁÐ
var newTd0 = newTr.insertCell();
//ÉèÖÃÁÐÄÚÈݺÍÊôÐÔ
newTd0.innerHTML =
"<label
Ïà¹ØÎĵµ£º
ugmbbc·¢²¼ÓÚ 2009-11-14 09:41:43| 7628 ´ÎÔĶÁ ×ÖÌ壺´ó С ´òÓ¡Ô¤ÀÀ
var ReTitle = '»Ø¸´:Google ÅÅÃûÖÐµÄ 10 ¸ö×îÖøÃûµÄ JavaScript ¿â';
¸ÐлCOMSHARP CMSµÄͶµÝ
ÐÂÎÅÀ´Ô´:tripwiremagazine.com
JavaScript ÊÇ Web ¿ª·¢ÓëÉè¼ÆÖв»¿É»òȱµÄ¶«Î÷£¬²»¹ÜÊÇÒ»¸ö¼òµ¥µÄÍøÒ³»¹ÊÇÒ»¸öרҵµÄÕ¾µã£¬Ò²²»¹ÜÄãÊǸßÊÖ»¹ÊDzËÄñ ......
±¾ÎÄ×÷ÕßΪDavid
Mandelin£¬©¤©¤Mozilla JavaScriptÍŶӹ¤×÷ÈËÔ±¡£
Firefox 3.5ÓµÓÐÒ»¸öȫеÄJavaScriptÒýÇ棬½Ð×öTraceMonkey£¬ÔÚ¸ÃÒýÇæÉÏÅÜJSÓ¦ÓÃÒª±ÈFirefox
3¿ìµ½3-4±¶£¬´Ó¶øΪÏÖÓеÄÍøÂçÓ¦ÓüÓËÙ¡£ÕâƪÎÄÕ´óÖµÄÃèÊöÒ»ÏÂÔÚTraceMonkeyÖаüÀ¨µÄÖØÒª²¿¼þ£¬ÒÔ¼°ËûÃÇÊÇÈçºÎ¼ÓËÙJavaScriptµÄ¡£Í¬Ñù£¬ÔÚÁ˽âÕâÐ ......
È¥³ý×Ö·û´®×óÓÒÁ½¶ËµÄ¿Õ¸ñ£¬ÔÚ
vbscript
Àï
Ãæ¿ÉÒÔÇáËɵØʹÓÃ
trim
¡¢
ltrim
»ò
rtrim
£¬µ«ÔÚ
js
ÖÐȴûÓÐÕâ
3
¸öÄÚÖ÷½·¨£¬ÐèÒªÊÖ¹¤±àд¡£ÏÂÃæµÄʵÏÖ·½·¨ÊÇÓõ½ÁËÕýÔò±í´ïʽ£¬Ð§Âʲ»´í£¬²¢°ÑÕâÈý¸ö·½·¨¼ÓÈë
String
¶ÔÏóµÄÄÚÖ÷½·¨ÖÐÈ¥¡£
<mce:script type="tex ......
ÑÝʾµØÖ·: http://www.wowo-design.com/view/51_01/index.htm
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>css²Ëµ¥ÑÝʾ</title>
<style type="text/css">
<!--
*{margin:0;padding:0;border:0;}
body {
......
ÈÕÇ°£¬Mozilla µÄ Arun Ranganathan Ïò W3C Ìá½»ÁËÒ»¸ö²Ý°¸£¬Ö¼ÔÚÍƳöÒ»¸ö JavaScript API£¬ÈÃ
JavaScript ½Å±¾Ö±½Ó²Ù×÷±¾µØÎļþ£¬Firefox µÄ×îÐÂä¯ÀÀÆ÷°æ±¾ÖÐÒѾ¶Ô¸Ã API ÌṩÁË´óÁ¿µÄÖ§³Ö£¬²»¹ý³öÓÚ°²È«¿¼ÂÇ£¬¸ÃAPI
½«Ö»¶Ô±¾µØÎļþÌṩÓÐÏ޵ķÃÎÊ¡£
¸Ã API ÒýÈëÁËÒ»¸ö FileReader ¶ÔÏ󣬿ÉÒÔÒì²½¼ÓÔر¾µØÎļþϵͳÖÐµÄ ......