Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Escaped nested quotes not working? 1

Status
Not open for further replies.

JavaSprout

Programmer
Jul 31, 2001
30
0
0
BE
I am trying to nest quotes as follows, and using the escape character, but I still get a JavaScript error message.


<input type=button value=OK onClick=&quot;javascript:window.opener.return_category(109359, '\&quot;Warburton, Patrick\&quot;');self.close();&quot;>

Any ideas why this doesn't work?
Even better, any ideas how to fix it?! ;)

Thanks!


Hugh Prior
webmaster
LocalPin Regional Directory
 
Do this:
<input type=button value=OK onClick='javascript:window.opener.return_category(109359, &quot;\&quot;Warburton, Patrick\&quot;&quot;);self.close();'>

The problem was that excaping the &quot; wasn't necessary for the JS--you didn't have any previous &quot; to require escaping this one. However, the HTML saw to start with &quot; and end at the next one, making this the JS it tried to interpret:
javascript:window.opener.return_category(109359, 'That is why there were errors--you can't escape in HTML.

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top