Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

AJAX: posting a ampersand?

 
Kevin Cornwell
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't seem to post a '&' in a post from via AJAX. Everything else works fine.

in my form..
oFrm.my_shout.value = 'foo & bar';

AJAX...


in my php...

returns...
foo
[ June 19, 2006: Message edited by: Kevin Cornwell ]
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to escape/encode it.

Just look at Google for JavaScript encodeURI or JavaScript escape

Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64683
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that this is not something that is Ajax specific -- when formatting a URL by hand you must encode parameter values.
 
Kevin Cornwell
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Works! Thanks Eric.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic