Hey guys! So I have kind of a weird question:
I've written some code that uses XMLHttpRequest(); to get data from a page on my server. It stores the response text in a variable, like so: resp=x.responseText;
I can use "alert(resp);" to view the text and I know it's working correctly.
My question is this: I want to then send this response text to another .php page, kind of like this: "http://www.example.com/test.php?c="+resp
However, because the response text has HTML code in it, as well as line breaks (\n) and other weird stuff, my test.php file isn't getting the data correctly. Do I have to like santize the "resp" string using some kind of HTML character conversion code or something? Do you have any suggestions?
Similar/related question: is there a way to just cut the "resp" content to the first like 200 characters? It responds with a ton of crap, which I really don't need beyond the first 200-300 characters or so.