Click to See Complete Forum and Search --> : How to use single quotation mark ' within a document.write('....')


turefugio
12-04-2003, 12:12 PM
I have the following expresion in a js file, it works fine, but does not recognize the 'cell_over" or the 'button' comand:

document.write('<td class="button" onmouseover="this.className='cell_over';" onmouseout="this.className='button';" align="center"><a href="1hazmehogar.html" class="menu">HAZME*HOGAR</a></td>');

I have tried using:
onmouseover="this.className=\'cell_over\'
onmouseover="this.className="Cell_over"
onmouseover="this.className=+'cell_over+'

I also tried document.writeln("..."); but it does not work with the rest of the js file.

Dennis
12-04-2003, 12:31 PM
so... if you do so:

<script>
document.write('This is a single quotation, \', can you see it?');
</script>



it goes... :)

turefugio
12-04-2003, 01:50 PM
I Tried that in the following format and it does not work!


Originally posted by Dennis
so... if you do so:

<script>
document.write('This is a single quotation, \', can you see it?');
</script>



it goes... :)

turefugio
12-04-2003, 01:53 PM
I Tried that in the following format and it does not work!

document.write('<td class="button" onmouseover="this.className= \'cell_over \';" onmouseout="this.className= \'button \';" align="center"><a href="1hazmehogar.html" class="menu">HAZME*HOGAR</a></td>');

turefugio
12-04-2003, 01:59 PM
I tried again and it does work.

document.write('<td class="button" onmouseover="this.className=\'cell_over\';" onmouseout="this.className=\'button\';" align="center"><a href="#envia" class="menu">ENVÍA*PAGINA</a></td>');

Thanks a lot :)