taxidev Posted August 8, 2014 Share Posted August 8, 2014 (edited) RESOLVED I am calling an update method in my javascript that sends an AJAX request to a PHP script. That compiles an array of values and is supposed to return a delimited string of name=value pairs like this: name1210=Tom Burns;company1210=Technet Center;id1210=2229 The PHP is compiling an array and then joining it with the delimeter. I did a var_dump from PHP on the resulting string and it returns exactly what I was expecting. However, when I get the string back into my AJAX environment, it looks like this: rn name1210=Tom Burns;company1210=Technet Center;id1210=2229 The carriage return line feed show up for who know why, and that makes the first name=value pair inaccessible, because I don't have an element named "rn name1210". I tried a string.replace on the full "rn" and on portions of it, to no avail. Does anyone know how I can either avoid getting this in the first place or getting rid of it afterward? Thank you. Tom Edited August 8, 2014 by taxidev Link to comment Share on other sites More sharing options...
taxidev Posted August 8, 2014 Author Share Posted August 8, 2014 I just figured it out. response.trim() did the trick. Link to comment Share on other sites More sharing options...
JamesB Posted August 8, 2014 Share Posted August 8, 2014 You would be better off modifying the server-side code to not output the rn. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now