473,394 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

JS Quotes

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>"
Aug 20 '05 #1
4 1963
scott wrote:
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>"

This may be easier:

....
%>
<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>

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=""javascript: " & _
"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"
Aug 21 '05 #2
thanks again. these quotes get nasty.

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:ec**************@TK2MSFTNGP15.phx.gbl...
scott wrote:
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>"

This may be easier:

...
%>
<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>

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=""javascript: " & _
"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"

Aug 21 '05 #3
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]" <re******@NOyahoo.SPAMcom> wrote in message
news:ec**************@TK2MSFTNGP15.phx.gbl...
scott wrote:
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>"

This may be easier:

...
%>
<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>

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=""javascript: " & _
"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"

Aug 21 '05 #4
"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
Aug 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Martin Goldman | last post by:
Hello all, I've been struggling for a few days with the question of how to convert "smart" (curly) quotes into straight quotes. I tried playing with the htmlentities() function, but all that is...
6
by: Cyrus D. | last post by:
Hi guys, I haven't done that much research on this topic but it seems I can use either the single quotes or the double quotes. SInce I am so used to C(++) I prefer the double quotes and am...
11
by: Jakanapes | last post by:
Hi all, I'm looking for a way to scan a block of text and replace all the double quotes (") with single quotes ('). I'm using PHP to pull text out of a mySQL table and then feed the text into...
4
by: Gerald Aichholzer | last post by:
Hello, I need to specify the following attribute in an xhtml-file containing TAL templates: <div tal:attributes="onMouseOver concat('func(',xyz,')')"> which results in <div...
24
by: deko | last post by:
I'm trying to log error messages and sometimes (no telling when or where) the message contains a string with double quotes. Is there a way get the query to insert the string with the double...
4
by: (PeteCresswell) | last post by:
Is his just a flat-out "No-No" or is there some workaround when it comes time for SQL searches and DAO.FindFirsts against fields containing same? I can see maybe wrapping the value searched for...
7
by: gar | last post by:
Hi, I need to replace all the double quotes (") in a textbox with single quotes ('). I used this code text= Replace(text, """", "'" This works fine (for normal double quotes).The problem...
3
by: Balaskas Evaggelos | last post by:
Hi to all, I am developing a php web browser application. But i have a problem. I am listing with opendir but there are a lot of files with quotes in their names. example: News Letter...
4
by: Michael Yanowitz | last post by:
Hello: If I have a long string (such as a Python file). I search for a sub-string in that string and find it. Is there a way to determine if that found sub-string is inside single-quotes or...
5
by: Brigitte Behrmann | last post by:
Please can some-one help, I cannot get this to work. <html> <head> <title>Random Proverbs</title> <script type="text/javascript"> <!-- HIDE FROM INCOMPATIBLE BROWSERS function changeQuote() {...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.