enter image description here

this responseText is containing two arrow signs.

enter image description here

But I didn't gave it in die("") in php

enter image description here

Because of it iam having a problem to show error message in ajax And copy pasting this "↵↵You have reached your note limit.", doesnot work.

  • I'd guess they are end of line markers, and are probably emitted by whitespace gaps between PHP sections further up the file. – Rup May 7 '19 at 13:18
  • do you know how to remove it? – Bikash Gurung May 8 '19 at 3:38
  • You'll have to track down where they come from. Try putting <?php die('You have reached your note limit.'); at the top of the file and see if you get the leading linebreaks. If you don't, try again part way down the file. When you've found a range of code that looks like it's generating one or more of the spaces, look for any echo s in that code, or gaps between PHP tags that might generate the linebreaks. – Rup May 8 '19 at 7:11
  • Alternatively you could change the output format to something that's permissive of extra whitespace, e.g. make it a simple JSON object. You'd then lose the whitespace when parsing the object. Or just tell your API users (if there are any apart from you) that they need to trim the string returned before processing it. – Rup May 8 '19 at 7:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.