ajax select Ìí¼Óoption ¿Õ°×
½ñÌ춯̬Ìí¼Óoptionµ½selectlʱ£¬³öÏÖÁËÌí¼ÓºóoptionΪ¿Õ°×£¬¸öÊýÈ´ÕýÈ·µÄÇé¿ö¡£´úÂëÈçÏ£º
for(var i = 0; i < results.length; i++) {
oOption = document.createElement("OPTION");
oOption.value=results[i].childNodes[0].text;
oOption.text=results[i].childNodes[1].text;
tabcodelist.appendChild(oOption);
}
ÔÚÍøÉÏÕÒÁË°ëÌ죬ҲûÕÒµ½½â¾ö°ì·¨£¬ºóÀ´¾¹ý×Ðϸ·ÖÎö£¬ºÍÒÔÇ°µÄ´úÂë¶Ô±È£¬·¢ÏÖÕâÒ»ÐÐtabcodelist.appendChild(oOption);Óë
ÒÔÇ°µÄ´úÂë²»Ò»Ñù£¬ÒÔÇ°ÓõÄÊÇadd·½·¨¶ø²»ÊÇappendChild·½·¨¡£¸Ä³ÉaddºóÎÊÌâ½â¾ö£¬°¦£¬ÕâôСµÄÒ»¸öÎÊÌâÀË·ÑÁË°ëÌì¾¢¡£JavaScriptÕæÊDz»ºÃÓã¬Ì«²»ÈÝÒ×ÕÒ´íÁË¡£
Ïà¹ØÎĵµ£º
Õ⼸Ì칤×÷£¬ÓõÄÊÇAJAX¿ò¼Ü£¬½á¹ûµ¼³öExcel±í¸ñµÄʱºòÎÞ·¨µ¼³ö¡£
½â¾ö°ì·¨£º1¡¢ÔÚ.aspxÒ³ÃæÊ×ÐÐÖÐ<%@ Page Language="C#" AutoEventWireup="true" CodeFile="JinHuoDan.aspx.cs" Inherits="out_store_JinHuoDan" %> Ìí¼ÓEnableEventValidation="false" £»
2¡¢ÔÚUPdatePanelÖÐÌí¼Ó</ContentTemplate>
......
AjaxµÄÔÀíºÜ¼òµ¥£¬¾ÍÊÇÔÚ¿Í»§¶Ë´´½¨Ò»¸öXMLHttpRequest¶ÔÏó£¨ÓÃÀ´Óë·þÎñÆ÷½øÐÐÒ첽ͨÐÅ£¬Õâ¾ÍÊÇAjaxµÄºËÐÄ£¬ÆäʵÎÒÃÇÔç¾ÍÔÚÓÃÒ첽ͨÐÅÁË£¬Ö»ÊÇû°ÑÕâÏî¼¼ÊõÓÃÔÚÍøÒ³Éè¼ÆÖжøÒÑ£©£¬Îª¸Ã¶ÔÏóµÄonreadystatechange ÊôÐÔÌí¼ÓÒ»¸öʼþ£¬µ±¶ÔÏóµÄreadyState¸Ä±äµÄʱºò¾Í»áÒý·¢Ö¸¶¨µÄʼþ¡£µ½´Ë¾Í¿ÉÒԾͷ¢ËÍÇëÇó¶ÁÈ¡·þÎñÆ÷¶ ......
ʵÏÖ×¢²á½çÃæÎÞË¢ÐÂÅжÏÖØÃû£¬ÓÉÓÚÒª·ÃÎÊÊý¾Ý¿â£¬ËùÒÔÒª´ïµ½ÎÞˢУ¬Ö»ÄÜÓÃAjax¼¼Êõ¡£
ÆäÖÐ×îÖØÒªµÄ¾ÍÊÇxmlHttp¶ÔÏó¡£
XmlHttpÊÇʲô£¿
×îͨÓõĶ¨ÒåΪ£ºXmlHttpÊÇÒ»Ì׿ÉÒÔÔÚJavascript¡¢VbScript¡¢JscriptµÈ½Å±¾ÓïÑÔÖÐͨ¹ýhttpÐÒé´«ËÍ»ò´Ó½ÓÊÕXML¼°ÆäËûÊý¾ÝµÄÒ»Ì×API¡£XmlHttp×î´óµÄÓô¦ÊÇ¿ÉÒÔ¸üÐÂÍøÒ³µ ......
ÉÏƪ½éÉÜÁËÈçºÎÔÚAjax¿Í»§¶ËÓë·þÎñÆ÷¶ËÖ®¼ä´«Ëͼòµ¥µÄÎı¾Êý¾Ý£¬Æäʵ£¬Ò²¿ÉÒÔʹÓÃXML×÷ΪÊý¾Ý´«ËÍ¡¢¹µÍ¨µÄ¸ñʽ£¬Ajax¿Í»§¶ËÈôÒª·¢ËÍXML£¬»ù±¾ÉϾÍÊǽ«XML×÷Ϊ×Ö·û´®£¬ÔÚPOSTÇëÇóʱ·¢ËÍ£¬ÀýÈ磺
*HelloAjax.js
var xmlHttp;
function createXMLHttpRequest() {
if (window.XMLHttpRequest) {
xmlHttp = new ......
±¾ÆªÎÄÕÂÖ÷Òª½éÉÜÈçºÎÔÚAjaxµÄ¿Í»§¶ËÓë·þÎñ¶ËÖ®¼ä´«ËÍJSON¸ñʽµÄÊý¾Ý¡£ÄÇôÎÒÃÇÏÈÀ´ËµËµÊ²Ã´ÊÇJSON°É¡£
JSON£¬¼´ÊÇJavaScript¶ÔÏó±ê¼Ç·¨£¬Ó¢ÎÄÃû³ÆÊÇJavaScript Object Notation£¬¼ò³ÆJSON
£¬ÊÇ JavaScript Programming Language,
Standard
ECMA-262 3rd Edition - December 1999
µÄ×Ó¼¯ºÏ£¬ÊÇ´ÓJavaScriptµÄo ......