JSON

ÌáÎÊ£ºÓÃajax£¬json¼¼Êõ×öµÄÁª¶¯²Ëµ¥

×ÖºÅ+ ×÷ÕߣºH5Ö®¼Ò À´Ô´£ºH5Ö®¼Ò 2015-09-14 11:08 ÎÒÒªÆÀÂÛ( )

ÌáÎÊ£ºÓÃajax£¬json¼¼Êõ×öµÄÁª¶¯²Ëµ¥¼òµ¥µãµÄ ÄãÖ±½ÓÓÃ.responseText½ÓÊÕÎı¾.·þÎñÆ÷ Ö±½Ó·Å»ØHTMLÎı¾,ÔÚÓÃinnerHTML Êä³ö²»¾ÃºÅÁË.var op=new Option(arr2[1],

ÌáÎÊ£ºÓÃajax£¬json¼¼Êõ×öµÄÁª¶¯²Ëµ¥ ÆäÖÐÓÐÒ»¶Î

//·þÎñÆ÷·µ»Ø yy,ÔÀÑô;cs,³¤É³;hh,»³»¯
if(xhr.readyState == 4){
var txt = xhr.responseText;
var arr = txt.split(';');
$('s2').innerHTML = '';
for(i=0;i<arr.length;i++){
var arr1 = arr[i];
var arr2 = arr1.split(',');
var op = new Option(arr2[1],arr2[0]);
$('s2').options[i] = op;
}
}
var op=new Option(arr2[1],arr2[0]):û¿´¶®
Ëü²»ÊÇ°´ÕÕ£¬ºÅÀ´·Ö¿ª£¬Ö»ÒªÏÔʾ ÔÀÑô£¬³¤É³£¬»³»¯ ¾ÍºÃÁË£¬Ç°Ãæyy,cs,hhÓÖûÓð¡

·ÖÏíµ½£º

¡¡

1.±¾Õ¾×ñÑ­ÐÐÒµ¹æ·¶£¬ÈκÎתÔصĸå¼þ¶¼»áÃ÷È·±ê×¢×÷ÕߺÍÀ´Ô´£»2.±¾Õ¾µÄÔ­´´ÎÄÕ£¬ÇëתÔØʱÎñ±Ø×¢Ã÷ÎÄÕÂ×÷ÕߺÍÀ´Ô´£¬²»×ðÖØÔ­´´µÄÐÐΪÎÒÃǽ«×·¾¿ÔðÈΣ»3.×÷ÕßͶ¸å¿ÉÄܻᾭÎÒÃDZ༭Ð޸Ļò²¹³ä¡£

Ïà¹ØÎÄÕÂ
  • php CI ʵս½Ì³Ì£º[5]ÓÃcurl»ñÈ¡json²¢½âÎö

    php CI ʵս½Ì³Ì£º[5]ÓÃcurl»ñÈ¡json²¢½âÎö

    2016-02-26 17:00

  •  JSONÈëÃż¶Ñ§Ï°×ܽá-JSONÊý¾Ý½á¹¹

    JSONÈëÃż¶Ñ§Ï°×ܽá-JSONÊý¾Ý½á¹¹

    2016-02-25 11:05

  • Android½âÎöJsonËÙ¶È×î¿ìµÄ¿â:json

    Android½âÎöJsonËÙ¶È×î¿ìµÄ¿â:json

    2016-02-13 18:00

  • JavaScriptת»»Óë½âÎöJSON·½·¨ÊµÀýÏê½âµÚ1/2Ò³

    JavaScriptת»»Óë½âÎöJSON·½·¨ÊµÀýÏê½âµÚ1/2Ò³

    2016-02-10 21:25

ÍøÓѵãÆÀ
Í