The JSON array returned by the JS loop processing background

Source: Internet
Author: User

1<script type="Text/javascript">2 function Gongdan_search (elm) {3         varDangqian_value=$ (Elm). Val ();4         if(dangqian_value) {5 $.ajax ({6Url:'__url__/order_infos_list_search',7Type'Post',8 Data:{dangqian_value:dangqian_value},9 success:function (data) {Ten                     if(data!=0){ One                         varD=eval ("("+data+")");//the JSON array returned by the JS loop processing background A                         varcompany=D.company; -                         varCus_name=D.cus_name; -                         varAddr=d.addr; the                         varCus_mobi=D.cus_mobi; -                         varWnumber=D.wnumber; -                         if(company) { -$('. Company_view'). HTML (company); +                         } -                         if(cus_name) { +$('. Cus_name_view'). HTML (cus_name); A                         } at                         if(addr) { -$('. Addr_view'). html (addr); -                         } -                         if(Cus_mobi) { -$('. Cus_mobi_view'). HTML (cus_mobi); -                         } in                         if(wnumber) { -$('. Gongdanhao_view'). Val (wnumber); to                         } +}Else{ -$('. Company_view'). HTML ('No data currently'); the$('. Cus_name_view'). HTML ('No data currently'); *$('. Addr_view'). HTML ('No data currently'); $$('. Cus_mobi_view'). HTML ('No data currently');Panax Notoginseng                     } -                 } the             }); +         } A     } the</script> +  -  $  $      Publicfunction Order_infos_list_search () { -$dangqian _value=$ This->_post ('Dangqian_value'); -         if(!$dangqian _value) { the             return false; -         }Wuyi$where=NULL; the$where['Wnumber']=$dangqian _value; -$result =m ('order_list'),where($where)->field ('wnumber,uid,cus_name,cus_mobi,addr'),find (); Wu         if(! $result ['UID']){ -             return false; About         } $$map =NULL; -$map ['UID']= $result ['UID']; -$factory _infos=m ('user_factory'),where($map)->field (' Company'),find (); -         if(!$factory _infos) { A             return false; +         } the$arr =Array (); -$arr [' Company']= $factory _infos[' Company']; $$arr ['Cus_name']= $result ['Cus_name']; the$arr ['Addr']= $result ['Addr']; the$arr ['Cus_mobi']= $result ['Cus_mobi']; the$arr ['Wnumber']= $result ['Wnumber']; the         if(!empty ($arr)) { -echo Json_encode ($arr);//returns an array of Josn in}Else{ theEcho0; the         } About     } the      the  the      + varcontent1=$ ("input[name= ' Compliant_jibie ']:checked"). Val ();//jquery Select the current radio button to get the value -alert (CONTENT1);

The JSON array returned by the JS loop processing background

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.