For Programmers: Free Programming Magazines  


Home > Archive > ASP > August 2005 > JS Quotes









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author JS Quotes
scott

2005-08-20, 6:55 pm

Can someone help me with quote syntax? The single quotes with javascript
function are messing me up.

CODE
---------
response.write ""<a href=""javascript:
VerifyDelete1('del-message.asp?fid=" iActiveForumId1 & "&mode=" & thread &
"&tid=" & iId "');">" & "<img src=""images/xsm-delete.gif"" width=""10""
height=""10"" border=""0"" alt=""Delete Message""></a></td>"


Bob Barrows [MVP]

2005-08-21, 7:55 am

scott wrote:
> Can someone help me with quote syntax? The single quotes with
> javascript function are messing me up.
>
> CODE
> ---------
> response.write ""<a href=""java script:
> VerifyDelete1('del-message.asp?fid=" iActiveForumId1 & "&mode=" &
> thread & "&tid=" & iId "');">" & "<img src=""images/xsm-delete.gif""
> width=""10"" height=""10"" border=""0"" alt=""Delete
> Message""></a></td>"



This may be easier:

....
%>
<a href="java script: VerifyDelete1('del-message.asp?fid=
<%= iActiveForumId1%>
&mode=
<%=thread %>
"&tid=
<%=iId%>
');>
<img src="images/xsm-delete.gif" width="10"
height="10" border="0" alt="Delete Message"></a></td>

However, if you MUST do it in a single response.write, my preference would
be to assign the string to a variable and response.write the variable ... it
makes the code a little cleaner:

<%
dim sHTML
....
sHTML= "<a href=""java script: " & _
"VerifyDelete1('del-message.asp?fid=" & iActiveForumId1 & _
"&mode=" & thread & "&tid=" & iId & "');"">" & vbcrlf & _
"<img src=""images/xsm-delete.gif"" width=""10"" " & _
"height=""10"" border=""0"" alt=""Delete Message""></a></td>"
....
%>
<html><body>
....
<%=sHTML%>
....

HTH,
Bob Barrows


--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


scott

2005-08-21, 6:55 pm

thanks again. these quotes get nasty.

"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:eceBG4kpFHA.4088@TK2MSFTNGP15.phx.gbl...
> scott wrote:
>
>
> This may be easier:
>
> ...
> %>
> <a href="java script: VerifyDelete1('del-message.asp?fid=
> <%= iActiveForumId1%>
> &mode=
> <%=thread %>
> "&tid=
> <%=iId%>
> ');>
> <img src="images/xsm-delete.gif" width="10"
> height="10" border="0" alt="Delete Message"></a></td>
>
> However, if you MUST do it in a single response.write, my preference would
> be to assign the string to a variable and response.write the variable ...
> it makes the code a little cleaner:
>
> <%
> dim sHTML
> ...
> sHTML= "<a href=""java script: " & _
> "VerifyDelete1('del-message.asp?fid=" & iActiveForumId1 & _
> "&mode=" & thread & "&tid=" & iId & "');"">" & vbcrlf & _
> "<img src=""images/xsm-delete.gif"" width=""10"" " & _
> "height=""10"" border=""0"" alt=""Delete Message""></a></td>"
> ...
> %>
> <html><body>
> ...
> <%=sHTML%>
> ...
>
> HTH,
> Bob Barrows
>
>
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>



scott

2005-08-21, 6:55 pm

Bob, can you help me again? I'm at a complete shutdown because of some
stupid quotes. Below in GOOD CODE, I have a mix of ASP/HTML that works. I'm
trying to
convert the GOOD CODE into all ASP, but I'm failing in BAD CODE.

BAD CODE:

sHTML=sHTML & "bgcolor=" & tblcolor & style=""cursor:default;""
onMouseOver="this.bgColor=""'#e6e6e6'"" onMouseOut="this.bgColor='" &
tblcolor & "'"

GOOD CODE:

<%
If sPageType = "forum" Then %>

bgcolor="<%= tblcolor %>" style="cursor:default;"
onMouseOver="this.bgColor='#e6e6e6'" onMouseOut="this.bgColor='<%= tblcolor
%>'"

<% End If %>>






"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:eceBG4kpFHA.4088@TK2MSFTNGP15.phx.gbl...
> scott wrote:
>
>
> This may be easier:
>
> ...
> %>
> <a href="java script: VerifyDelete1('del-message.asp?fid=
> <%= iActiveForumId1%>
> &mode=
> <%=thread %>
> "&tid=
> <%=iId%>
> ');>
> <img src="images/xsm-delete.gif" width="10"
> height="10" border="0" alt="Delete Message"></a></td>
>
> However, if you MUST do it in a single response.write, my preference would
> be to assign the string to a variable and response.write the variable ...
> it makes the code a little cleaner:
>
> <%
> dim sHTML
> ...
> sHTML= "<a href=""java script: " & _
> "VerifyDelete1('del-message.asp?fid=" & iActiveForumId1 & _
> "&mode=" & thread & "&tid=" & iId & "');"">" & vbcrlf & _
> "<img src=""images/xsm-delete.gif"" width=""10"" " & _
> "height=""10"" border=""0"" alt=""Delete Message""></a></td>"
> ...
> %>
> <html><body>
> ...
> <%=sHTML%>
> ...
>
> HTH,
> Bob Barrows
>
>
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>



Giles

2005-08-22, 7:55 am

"scott" wrote >
> GOOD CODE:
>
> <%
> If sPageType = "forum" Then %>
>
> bgcolor="<%= tblcolor %>" style="cursor:default;"
> onMouseOver="this.bgColor='#e6e6e6'" onMouseOut="this.bgColor='<%=
> tblcolor
> %>'"


Try (untested!) (on one line)

response.write "bgcolor=""<%= tblcolor %>"" style=""cursor:default;""
onMouseOver=""this.bgColor='#e6e6e6'"" onMouseOut=""this.bgColor='<%=
tblcolor %>'"""

There is a (VBS) HTML-To-String converter at
http://www.verifiedlearning.com/convertscripts.htm

Not bulletproof, but I use it for this common task.
Hope that helps
Giles


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com