I'm a newbie to jQuery, but I've been working with the Ajax function
to process form values, using a javascript confirmation, and although
the alert message works, it keeps putting a "\" character before the
message.

For example, my code in my form check form is as follows:

$.ajax({
  type: "POST",
  url: domain+"/ishopstudio.com/factory/ajax.php",
  data:  { trigger: "contactrequest",message: message },
  success: function(msg){
     alert( msg );
 }
 });

The message is being set in my ajax.php file:

$str="Thank you, your message has been sent!";

return $str;

And when I submit the form I get the message:

\Thank you, your message has been sent!

But obviously I don't want the slash character at the beginning. I
cannot figure out where this is coming from, I've checked all my files
for rogue characters but it looks like it's being produced on the fly
for some reason....does anyone have any ideas?

Thank you.

Reply via email to