[thelist] Window Popup Problem

Chris at globet.com Chris at globet.com
Fri Feb 17 11:10:33 CST 2006


John

[..]

> <a class="font_channels" href="#"
> onClick="document.logonForm.url.value='http://library.alldatapro.com';
> document.logonForm.submit();" onMouseOver="return escape('The 
> world\'s most comprehensive resource for automotive 
> diagnostic and repair information.')" target="_blank"><img 
> src="https://www.sheridan.edu/uportal/icons/all-icons/jbruso_c
> ustom/new_
> window.png" alt="Click, to open in new window." width="12" height="10"
> border="0"></a>

Some points:

1. You have an anchor tag around an image with the HREF attribute set to
'#'. This references the current page.

2. The target for the hyperlink is '_blank'. This will target a new
window.

3. You have some javascript that executes when the onclick event handler
is invoked.

Therefore, in order: the user clicks on the image, the javascript
executes, and the page referenced by the anchor tag (current page) opens
in the target window (_blank).

Why not simply reference the target page in the HREF attribute of the
anchor tag, and specify the target as you have done. This will make the
page accessible to all. If you want to have some control over the new
window, then execute your [optional] javascript in the onclick event
handler finishing it off with 'return false;' which will prevent the
link from being followed by the browser.

HTH

Chris Marsh
Web Developer
http://www.globet.com/
Tel: +44 20 8246 4804 Ext 828
Fax: +44 20 8246 4808

Any opinions expressed in this email are those of the individual and not
necessarily the Company. This message is intended for the use of the
individual or entity to which it is addressed and may contain
information that is confidential and privileged and exempt from
disclosure under applicable law. If the reader of this message is not
the intended recipient, you are hereby notified that any dissemination,
distribution, or copying of this communication is strictly prohibited.
If you have received this communication in error, please contact the
sender immediately and delete it from your system. 



More information about the thelist mailing list