JavaScript XMLHttpRequestµÄÓô¦
Èç¹ûÏë´ÓÍøÒ³Ìá½»²ÎÊýµ½·þÎñÆ÷£¬µÚÒ»¸öÏëµ½µÄ¾ÍÊÇHttpµÄForm±êÇ©¡£Ëü½«Óû§ÔÚ¿Í»§¶ËÍøÒ³ÌîдµÄÊý¾Ýͨ¹ýHTTP Post£¬Ìá½»µ½·þÎñ¶Ë¡£ÕâЩÌá½»µÄÊý¾Ý±»·ÅÔÚHTTPÏûÏ¢µÄbodyÀïÃ棬ÕâÑù£¬Óû§Ìá½»µÄÊý¾ÝÀíÂÛÉÏÊÇûÓ㤶ÈÏÞÖƵġ£Èç¹û·þÎñ¶ËÓõÄÊÇJ2EE£¬HttpServletRequest¿ÉÒԷdz£ÇáËɵÃÈ¡µ½ËùÓвÎÊý£¬·Ç³£ÍêÃÀ¡£
µ«ÊÇ£¬ÓÐһЩÌØÊâµÄÓ¦Óã¬Èç¹û·þÎñ¶Ë²»ÊÇJ2EE£¬Ã»ÓÐHttpServletRequest£¬¶øÊÇJava SocketʵÏÖ£¬½ÓÊܵ½µÄHTTPÏûÏ¢ÊÇ×îÔʼµÄ×Ö½ÚÁ÷¡£ÕâЩ×Ö½ÚÁ÷±»Ò»¸ö¼òµ¥µÄHTTP Message½âÎöÆ÷½âÎö¡£ÎÊÌâÊÇ£¬ÎªÁË´¦Àí¼òµ¥£¬Õâ¸ö½âÎöÆ÷Ö»½âÎöÁËHTTPÏûÏ¢µÄÍ·²¿£¬Ã»ÓнâÎöHTTPÏûÏ¢µÄbody²¿·Ö¡£Õâʱ£¬¿Í»§¶ËÐèÒªÌύһЩ³¤¶ÈÓÐÏÞµÄÊý¾Ý¸ø·þÎñ¶Ë£¬Èç¹û»¹ÊÇÓÃFormÌá½»Êý¾Ý£¬ÏÔȻͨ²»¹ý¡£ºÜ×ÔÈ»£¬Êý¾ÝÖ»ÄÜ´æÔÚHTTPÏûÏ¢µÄÍ·²¿¡£ÕâÊÇForm×ö²»µ½µÄ£¬Ó¦¸ÃÇóÖúÓÚÆäËûµÄ½Å±¾¹¤¾ß£¬ÕâÀï½éÉÜJavaScriptµÄXMLHttpRequest¡£
XMLHttpRequest¿ÉÒÔÔÚHTTPÏûÏ¢µÄÍ·²¿Ôö¼ÓÀ©Õ¹µÄmeta header£¬Ò²¿ÉÒÔÏñFormÒ»Ñù£¬°ÑÊý¾ÝÌá½»µ½HTTPÏûÏ¢µÄbody²¿·Ö¡£ÏÂÃæÕâ¶Î´úÂëÊÇÒ»¸ö×Ô¶¯Ìá½»µÄÀý×Ó¡£"http://localhost:8080/TestForm/HandleForm"ÊÇ·þÎñÆ÷¶ËµØÖ·¡£
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript">
function createReq() {
var req = false;
if (window.XMLHttpRequest) { //Mozilla
req = new XMLHttpRequest();
} else if (window.ActiveXObject) { //IE
try {
req = new ActiveXObject("Microsoft.XMLHTTP"); //IE6
} catch (e) {
try {
req = new ActiveXObject("MsXML2.XMLHTP");
} catch (e) {
alert(" Create a XMLHttpRequest object failed! ");
}
}
}
return req;
}
&nbs
Ïà¹ØÎĵµ£º
//the common event,If your brower is firefox,you should use this function instead of "window.event"
function getEvent() {
if(document.all)
return window.event; //get ie event
func=getEvent.caller;
while(func!=null) {
......
<html>19Â¥¿Õ¼ä,`(uqj3~9?!F
<body>
Ob*p#?L;DL0<scrīpt LANGUAGE="Javascrīpt">
+t:{z]tbs0var s = "";19Â¥¿Õ¼äe kA3HoT1H
s += "ÍøÒ³¿É¼ûÇøÓò¿í£º" + document.body.clientWidth;19Â¥¿Õ¼äcy2if}:H/SE@
s += "<br>ÍøÒ³¿É¼ûÇøÓò¸ß£º"+ document.bo ......
7¡¢dojo.jsµÄдÀ෽ʽ
dojo×îÐÂÊÇ1.3.1ÁË£¬¼ÇµÃ07Äêʱ»¹ÊÇ0.4¡£ÎĵµÒ²½¥½¥¶àÁËÆðÀ´£¬ÓÃdojoµÄÒ²ÂýÂý¶àÁË¡£dojo»¹·¢²¼ÁËcore°æ£¬Ñ¹ËõºóÖ»ÓÐ
27kb¡£dojoÖÐÓÃdojo.declare·½·¨À´¶¨ÒåÒ»¸öÀà¡£dojo.declareµÄÔ´Âë¾Í²»ÌùÔÚÕâÀïÁË¡£dojo.declareÓÐÈý¸ö²Î
Êý£¬
²ÎÊý1£ºÀàÃûclassName
²ÎÊý2£º¼Ì³ÐµÄÀàsuperclass
²ÎÊý3£º¹¹ÔìÆ÷ ......
1 ¿ò¼Ü±à³Ì¸ÅÊö
Ò»¸öHtml Ò³Ãæ¿ÉÒÔÓÐÒ»¸ö»ò¶à¸ö×Ó¿ò¼Ü£¬ÕâЩ×Ó¿ò¼ÜÒÔ<iframe>À´±ê¼Ç£¬ÓÃÀ´ÏÔʾһ
¸ö¶ÀÁ¢µÄHtml Ò³Ãæ¡£ÕâÀïËù½²µÄ¿ò¼Ü±à³Ì°üÀ¨¿ò¼ÜµÄ×ÔÎÒ¿ØÖÆÒÔ¼°¿ò¼ÜÖ®¼äµÄ»¥Ïà·ÃÎÊ£¬
ÀýÈç´ÓÒ»¸ö¿ò¼ÜÖÐÒýÓÃÁíÒ»¸ö¿ò¼ÜÖеÄJavaScript±äÁ¿¡¢µ÷ÓÃÆäËû¿ò¼ÜÄڵĺ¯Êý¡¢¿ØÖÆÁíÒ»
¸ö¿ò¼ÜÖÐ±íµ¥µÄÐÐΪµ ......