jQuery Ajax returns the whole page

前端 未结 6 1882
执念已碎
执念已碎 2020-11-28 10:52

I have a jquery-ajax function that sends data to a php script and the problem is with the return value, it returns the whole page instead of single value.

Thank you

6条回答
  •  一向
    一向 (楼主)
    2020-11-28 11:55

    I've just been making the move from pure JavaScript to jQuery because of, well, peer pressure, and finding it frustrating. In particular, getting whole pages of PHP back from an Ajax POST request. I have read and re-read this page several times in the past two days when this kept happening. In the end, the problem in both cases that I'd either spelled the php url wrong in the Ajax setup or put the wrong path to the file.

    Sometimes it's the easiest little things that trip you up!

    I hope that this will save somebody out there some time...

提交回复
热议问题