How to send 'data' to ASMX web service via AJAX POST?

后端 未结 3 1279
滥情空心
滥情空心 2021-02-04 22:27

I can successfully receive values from my web service so in that repect the script is working fine. However I am now trying to send data to the webservice using the \'data\' fie

3条回答
  •  名媛妹妹
    2021-02-04 22:49

    jQuery takes the data argument and converts it into the appropriate type of request variables.

    So you use something like:

    data: { myParameterName: "myParameterValue", myParameterName2: "myParameterValue2" }
    

    and jQuery does the rest of the work for you.

    A specific example based on a comment:

    data: { toSend: "test" }
    

提交回复
热议问题