passing multiple parameters to .asmx from jquery ajax GET

前端 未结 3 1507
猫巷女王i
猫巷女王i 2021-02-20 18:09

html

fill in names and check it out

Enter First Name

3条回答
  •  渐次进展
    2021-02-20 19:01

    • Your first attempt is passing the paramaters as a json string.
    • Your second attempt is missing = signs.

    You can pass a object to data, and jQuery will serialize it properly.

    $.ajax(
            {
                post: 'GET',
                data: {
                    firstName: $('myFirstName').val(),
                    lastName: $('myLastName').val()
                },
    ...
    

提交回复
热议问题