Passing Javascript Variable to PHP using Ajax

前端 未结 2 607
终归单人心
终归单人心 2020-11-28 16:54

I\'m working on an existing script at the moment which uses Ajax, something I\'ve never worked with before. I have a variable set in my javascript file which gets its value

相关标签:
2条回答
  • 2020-11-28 17:06

    Or you can do this:

    data: "userID=" + onlyID + "&credoff=" + credoff
    

    don't forget the ampersand! &

    0 讨论(0)
  • 2020-11-28 17:19
    ...
    data: {
        userId: onlyID,
        credoff: credoff
    },
    ...
    
    0 讨论(0)
提交回复
热议问题