<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2652.35">
<TITLE>RE: [Javascript] Using data with a single quote in a Javascript open</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>There is some great help on ASP at <A HREF="http://www.asplists.com/asplists/aspclient.asp" TARGET="_blank">http://www.asplists.com/asplists/aspclient.asp</A></FONT>
</P>

<P><FONT SIZE=2>On your ASP page try concatenating the line before response.write:</FONT>
</P>

<P><FONT SIZE=2>Dim lineOut</FONT>
<BR><FONT SIZE=2>lineOut = &quot;&lt;a href=&quot;</FONT>
<BR><FONT SIZE=2>lineOut= lineOut &amp; chr(34) &amp;&quot;#&quot; chr(34)</FONT>
<BR><FONT SIZE=2>lineOut= lineOut &amp; &quot; onClick=&quot; &amp; chr(34) &amp; &quot;javascript:window.open&quot;</FONT>
<BR><FONT SIZE=2>lineOut= lineOut &amp; &quot;('radiopopupgenerator.htm?MP3=&quot;</FONT>
<BR><FONT SIZE=2>lineOut= lineOut &amp; Server.HTMLEncode(rs.Fields(&quot;FileName&quot;).Value)</FONT>
<BR><FONT SIZE=2>lineOut= lineOut &amp; &quot;&amp;title=&quot;</FONT>
<BR><FONT SIZE=2>lineOut= lineOut &amp; Server.HTMLEncode(rs.Fields(&quot;StoryName&quot;).Value)</FONT>
<BR><FONT SIZE=2>lineOut= lineOut &amp; &quot;','Audio','width=240,height=190,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=yes');&quot;</FONT></P>

<P><FONT SIZE=2>lineOut= lineOut &amp; chr(34) &amp; &quot;&gt;&quot;</FONT>
</P>

<P><FONT SIZE=2>response.write lineOut</FONT>
</P>

<P><FONT SIZE=2>Bob Filipiak</FONT>
<BR><FONT SIZE=2>(Contractor)</FONT>
</P>
<BR>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: David Chance [<A HREF="mailto:david_chance@yahoo.com.au">mailto:david_chance@yahoo.com.au</A>]</FONT>
<BR><FONT SIZE=2>Sent: Friday, September 28, 2001 12:00 AM</FONT>
<BR><FONT SIZE=2>To: javascript@LaTech.edu</FONT>
<BR><FONT SIZE=2>Subject: [Javascript] Using data with a single quote in a Javascript</FONT>
<BR><FONT SIZE=2>open</FONT>
</P>
<BR>

<P><FONT SIZE=2>How can I use data with a single quote in a Javascript open</FONT>
<BR><FONT SIZE=2>window statement??</FONT>
</P>

<P><FONT SIZE=2>I'm retreiving data from Access using asp, and I'm then using an</FONT>
<BR><FONT SIZE=2>on click window.open to open a window that loads up RealPlayer</FONT>
<BR><FONT SIZE=2>content:</FONT>
</P>

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

<P><FONT SIZE=2>The problem happens when some of my data has single quotes in</FONT>
<BR><FONT SIZE=2>it. The page chokes.</FONT>
</P>

<P><FONT SIZE=2>I'm assuming I need to be place the recordset value in a</FONT>
<BR><FONT SIZE=2>variable and parse for the ' and add a second one to it, but I'm</FONT>
<BR><FONT SIZE=2>having problems doing this.</FONT>
</P>

<P><FONT SIZE=2>Any ideas??</FONT>
</P>

<P><FONT SIZE=2>Thanks a lot!!!</FONT>
</P>

</BODY>
</HTML>