Unwanted new line returned after AJAX request

后端 未结 4 540
执念已碎
执念已碎 2021-01-13 05:23

I\'m using an ajax request to send comments to DB. Succesful response is marked by

1. OK

The problem actually is that the response from the

4条回答
  •  悲哀的现实
    2021-01-13 06:18

    If you're using jQuery

    you can use jQuery.trim(responseData) in your AJAX success callback, to get rid of the white spaces

    see also here http://api.jquery.com/jQuery.trim/

    hope it helps

提交回复
热议问题