ajax post within jquery onclick

前端 未结 4 1753
伪装坚强ぢ
伪装坚强ぢ 2021-01-11 09:01

I have a button which calls a modal box to fade into the screen saying a value posted from the button then fade off, this works fine using jquery, but I also want on the sam

4条回答
  •  执念已碎
    2021-01-11 09:46

    Try this. Edited to the final answer.

    button:

    script:

    
    

    reservebook.php:

    
    

    PS#1: The change to mysqli is minimal to your code, but strongly recommended.

    PS#2: The success on Ajax call doesn't mean the query was successful. Only means that the Ajax transaction went correctly and got a satisfatory response. That means, it sent to the url the correct data, but not always the url did the correct thing.

提交回复
热议问题