When using Ajax to pass a list to the front and back, use value[] to get the value

Source: Internet
Author: User

When using JSON for front and back interaction, if it is a list, you can pass Value[index], (index indicates subscript)

1 //Loading News2 functionJzxw () {3 $.ajax ({4Type: ' POST ',5DataType: ' JSON ',//JSON Object6URL: ' Order1!show1.action ',7Data:NULL,8Success:function(response, status, XHR) {9             vars = "";Ten$.each (Response,function(Index, value) { One                                 //Combination As + = ' <tr><td> ' +value[1]; -s + = ' </td><td> ' + value[2] -+ ' </td><td> ' + value[3] the+ ' </td><td> ' + value[4] -+ ' </td><td> ' -s + = ' <a class= "btn btn-info" onclick= "Scxw (' +value[0]+ ') ' > Audited </a> '; -s + = ' </td></tr> '; +                             }) -             //$ (s). InsertAfter ("#xwmain tr"); +             //$ ("#xwmain tr"). First (). After (). empty;  A             //$ ("#xwmain tr"). First (). after (s); at$ ("#table_id tbody"). HTML (s);  -         }, -Error:function() { -Alert ("Load Failed"); -         } -  in     }) -  to}

When using Ajax to pass a list to the front and back, use value[] to get the value

Related Article

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.