JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 25th, 2007, 12:37 AM
xreddawg909x xreddawg909x is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2005
Posts: 91 xreddawg909x User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 1 h 27 m 20 sec
Reputation Power: 3
Escape \

say i have a document.write command like this :
Code:
document.write('<td width="137"><a href="main1.htm"  onmouseover="window.status='Home Page \'; return true, SwapOut()" onmouseout="window.status=' \'; return true, SwapBack() "> <img src="graphics/home.bmp" name="imageflip" border ="0" align="left" /> </a> </td>')


assuming its all on one line are the escape \'s placed in the right positions ?

Reply With Quote
  #2  
Old December 25th, 2007, 11:59 AM
Mittineague's Avatar
Mittineague Mittineague is offline
Contributing User
Click here for more information
 
Join Date: Jul 2005
Location: West Springfield, Massachusetts
Posts: 549 Mittineague User rank is Private First Class (20 - 50 Reputation Level)Mittineague User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 1 Day 7 h 3 m
Reputation Power: 4
escapes

It doesn't look like it to me. You can use single or double quotes to enclose a string. As long as the quotes inside the string are the other kind, they don't need to be escaped. But all quotes should be evenly paired.
Your example uses single quotes to enclose the string, so paired double quotes won't need to be escaped. The first unescaped single quote encountered will terminate the string.
Code:
onmouseover="window.status='Home Page \'; return true, SwapOut()"
onmouseout="window.status=' \'; return true, SwapBack() "
__________________
WP plugins - Error Reporting, Clean Options
http://www.mittineague.com/dev/er.php
http://www.mittineague.com/dev/co.php

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Escape \


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT