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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why can't I escape quotes?

Status
Not open for further replies.

TheDust

Programmer
Aug 12, 2002
217
US
I'm an ASP.NET programmer... I have no real experience developing in ASP, but I'm trying to edit some old code for a client to simply output some different HTML code. Can someone tell me why the following line breaks the page? I'm trying to escape the quotes where needed and it's just not working...

Code:
<% response.write "<a href=\"javascript:PopupPic('" & rs("pImage") & "')\">" %>
 
<% response.write "<a href=""javascript:popupPic('" & rs("pImage") & "')"">" %>

u use "" to escape a "

Known is handfull, Unknown is worldfull
 
Thanks! I looked all over the net for that small piece of info and got nowhere. Much appreciation.
 
You already use douple quotes to open & close the response.write statement.

Response.Write " ........ "

If you have another " inside statement, the scrip will think that you want to close the statement.

So, you need to replace " with "" or just '

LIke this:
Code:
<% response.write "<a href='javascript:PopupPic('" & rs("pImage") & "')'>" %>

OR
<% response.write "<a href=""javascript:PopupPic('" & rs("pImage") & "')"">" %>

Hope this help.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top