View Single Post
Old May 26th, 2006, 1:41 AM   #2
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,024
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
Every time you want to use a single-quote, use a \ before it. In javascript \ is the escape character, it allows you to escape the functionality of the single quote.

\'

Example:

document.write('<a href="javascript: popup(\'http://google.com\');">Google</a>');
Sane is offline   Reply With Quote