[thelist] JavaScript window.open and alternative

John.Brooking at sappi.com John.Brooking at sappi.com
Fri Aug 20 18:09:26 CDT 2004


Here's what must be a fairly standard problem, and I would search for the
answer except I have no idea how to describe it succinctly enough for a
search engine. I want to open a new window for a help page. For clients
which support JavaScript, I know how to use window.open to give it the size
and characteristics I want (no address bar, etc.), but I also am mindful of
providing a backup for clients without JavaScript. Do any of you have a
preferred way of doing that?

The only solution I can think of would be to write out the JavaScript form
of the link using JavaScript itself, as in:

    document.write( "<a href='javascript: window.open( ...
    
and then use <noscript> to provide the alternate, HTML-only link.

But one problem is I know I'm going to get tripped up by all the levels of
quoting where I have put the "..." above. Besides, this doesn't seem real
elegant. Is there a better way? Maybe a fancier variation of a single <A
href...> tag?

- John
--
This message may contain information which is private, privileged or
confidential and is intended solely for the use of the individual or entity
named in the message. If you are not the intended recipient of this message,
please notify the sender thereof and destroy / delete the message. Neither
the sender nor Sappi Limited (including its subsidiaries and associated
companies) shall incur any liability resulting directly or indirectly from
accessing any of the attached files which may contain a virus or the like. 


More information about the thelist mailing list