Jquery Ajax binding MultiSelect Multi-select drop-down OPTION while executing the return value asynchronously

Source: Internet
Author: User

Jquery Ajax binding MultiSelect Multi-select drop-down OPTION while asynchronously executing get return value

1         functionLoad (Mslt_employees,belongto,mark) {//Incoming $ (#ID)2             varJsondata =json.stringify ({belongto:1, username:username});3             varEMP =NULL;4 Jquery.ajax ({5Type: ' POST ',6URL: ".. /tools/employees_ajax.ashx?action= "+ Action +" ",7DataType: "JSON",//Return JSON object8 Data:jsondata,//Upload parameters in JSON format9Cachefalse,TenAsyncfalse,//Asynchronous execution OneSuccessfunction(message) { A mslt_employees.empty ();//emptying the drop-down label -                     if(Message! = "0" && message! = "None") { -                         varList =message; the                          for(vari = 0; i < list.length; i++) { -                             if(Mark = = 1) { -                                 if(Belongto! = 1) {//Set default options -Mslt_employees.append ($ ("<option value= '" + list[i]. USERNAME + "' disabled = ' disabled ' >" + list[i]. USERNAME + "</option>")); +}Else { -Mslt_employees.append ($ ("<option value= '" + list[i]. USERNAME + ">" + list[i]. USERNAME + "</option>")); +                                 } A}Else { atMslt_employees.append ($ ("<option value= '" + list[i]. USERNAME + ">" + list[i]. USERNAME + "</option>")); -                             } -                             if(i = = 0) {emp = List[i]. USERNAME; }Else { -EMP = emp + "," +List[i]. USERNAME; -                             } -                         } in                     } -Mslt_employees.multiselect (' Refresh ');//Refresh Multi-Select drop-down label to}, Error:function() {return NULL; } +             }); -             returnemp;//return value the}

Original source: http://www.cnblogs.com/OnlyDreams/p/4143515.html
Reprint please keep this link

Jquery Ajax binding MultiSelect Multi-select drop-down OPTION while executing the return value asynchronously

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.