473,799 Members | 3,832 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

JS Quotes

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

CODE
---------
response.write ""<a href=""javascri pt:
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 1989
scott wrote:
Can someone help me with quote syntax? The single quotes with
javascript function are messing me up.

CODE
---------
response.write ""<a href=""javascri pt:
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="javascrip t: 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=""javascri pt: " & _
"VerifyDelete1( 'del-message.asp?fid =" & iActiveForumId1 & _
"&mode=" & thread & "&tid=" & iId & "');"">" & vbcrlf & _
"<img src=""images/xsm-delete.gif"" width=""10"" " & _
"height=""1 0"" 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******@NOyah oo.SPAMcom> wrote in message
news:ec******** ******@TK2MSFTN GP15.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=""javascri pt:
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="javascrip t: 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=""javascri pt: " & _
"VerifyDelete1( 'del-message.asp?fid =" & iActiveForumId1 & _
"&mode=" & thread & "&tid=" & iId & "');"">" & vbcrlf & _
"<img src=""images/xsm-delete.gif"" width=""10"" " & _
"height=""1 0"" 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="th is.bgColor=""'# e6e6e6'"" onMouseOut="thi s.bgColor='" &
tblcolor & "'"

GOOD CODE:

<%
If sPageType = "forum" Then %>

bgcolor="<%= tblcolor %>" style="cursor:d efault;"
onMouseOver="th is.bgColor='#e6 e6e6'" onMouseOut="thi s.bgColor='<%= tblcolor
%>'"

<% End If %>>


"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:ec******** ******@TK2MSFTN GP15.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=""javascri pt:
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="javascrip t: 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=""javascri pt: " & _
"VerifyDelete1( 'del-message.asp?fid =" & iActiveForumId1 & _
"&mode=" & thread & "&tid=" & iId & "');"">" & vbcrlf & _
"<img src=""images/xsm-delete.gif"" width=""10"" " & _
"height=""1 0"" 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:d efault;"
onMouseOver="th is.bgColor='#e6 e6e6'" onMouseOut="thi s.bgColor='<%=
tblcolor
%>'"


Try (untested!) (on one line)

response.write "bgcolor="" <%= tblcolor %>"" style=""cursor: default;""
onMouseOver=""t his.bgColor='#e 6e6e6'"" onMouseOut=""th is.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
12332
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 doing is changing the smart quotes into nonsense characters. I also searched the web for quite a while and was unsuccessful in finding a solution. What puzzles me is that doing it the other way around is simple enough. For example, this works...
6
1973
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 wondering if they could possible be less efficient. Maybe I should get in the habit of using single quotes with Php instead ? I like my code to be consistent, so in two very similar circumstances I don't want one set of code using single quotes and...
11
36183
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 a javascript function called by onClick. The problem is that the text may contain single or double quotes, which screws up the javascript. I eliminated the single quote problem by running the text through addslashes, but the double quotes are a...
4
8340
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 onMouseOver=func( )>
24
22664
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 quotes? Do I need to use code to scrub each string and remove or escape the double quotes before using it in a query? The error I get is this: Error Number 3075: Syntax error (missing operator) in query expression '"credit card billed by...
4
13468
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 in single quotes to deal with embedded double quotes, but if there are both embedded single AND double quotes, I can't see any way to deal with it. So, am I doing the right thing to remove all embedded double quotes from my data and write...
7
21035
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 comes in when you copy a double quote from MS Word and paste it in the text box. What happens is the double quote becomes slanted (“) so my code above can't filter it. I tried to do this text= Replace(text, "““","'")
3
1974
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 for "ebal" today.html
4
12783
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 double-quotes or not inside any quotes? If so how? Thanks in advance: Michael Yanowitz
5
4066
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() { var quotes = new array() quotes = "Laughter is the best medicine";
0
10257
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10237
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10029
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7567
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5588
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4144
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.