How do I pass along variables with XMLHTTPRequest

后端 未结 7 813
孤街浪徒
孤街浪徒 2020-11-30 03:47

How do I send variables to the server with XMLHTTPRequest? Would I just add them to the end of the URL of the GET request, like ?variable1=?v

7条回答
  •  醉话见心
    2020-11-30 04:14

    The correct format for passing variables in a GET request is

    ?variable1=value1&variable2=value2&variable3=value3...
                     ^ ---notice &--- ^
    

    But essentially, you have the right idea.

提交回复
热议问题