|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 ? |
|
#2
|
||||
|
||||
|
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 |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Escape \ |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|