Javascript escaping problem

Javascript escaping problem

Post by Ghost » Fri, 15 Jun 2007 23:52:39


Hi guys,

I have found this porblem and I cannot seem to find the source of it,
I hope that someone out there can help me.

The application is running tomcat, jboss, Apache Struts, Apache tiles.

In one of the pages I have a search filed (source below)

<input name="q" type="text" value="Search"
onfocus=" if (this.value==this.defaultValue) this.value='' "
onblur="if (this.value=='') this.value='Search' " />

This works fin on our main website, but for some reason when the page
is displayed through this system the ' are being escaped and turned
into ', which means the javascript has errors in it.

I have tried putting \ in front of the ' and that doesnt seem to work.

I have crawled the web and come up with nothing.

I had a similar problem with an if statement inside a script tag - the
off the server and linking to it with the src param.

Does anyone out there have any ideas about how to stop this escaping
of characters, its driving me insane!

Many thanks,

Simon Yeldon