[Javascript] Using data with a single quote in a Javascript open

David Chance david_chance at yahoo.com.au
Thu Sep 27 22:59:44 CDT 2001


How can I use data with a single quote in a Javascript open
window statement??

I'm retreiving data from Access using asp, and I'm then using an
on click window.open to open a window that loads up RealPlayer
content:

<a href="#"
onClick="javascript:window.open('radiopopupgenerator.htm?MP3=<%=Server.HTMLEncode(rs.Fields("FileName").Value)%>&title=<%=Server.HTMLEncode(rs.Fields("StoryName").Value)%>','Audio','width=240,height=190,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=yes');">

The problem happens when some of my data has single quotes in
it. The page chokes.

I'm assuming I need to be place the recordset value in a
variable and parse for the ' and add a second one to it, but I'm
having problems doing this.

Any ideas??

Thanks a lot!!!

http://travel.yahoo.com.au - Yahoo! Travel
- Got Itchy feet? Get inspired!



More information about the Javascript mailing list