Forum Moderators: open

Message Too Old, No Replies

Need to open popup window on clicking link

Need urgent help.

         

DeveloperMind

7:48 am on Jan 5, 2007 (gmt 0)

10+ Year Member



I am using javascript function to open popup by clicking link.

<a href="javascript:OpenPopUp();">Click to open popup</a>

Can I use this method to open popup or it may be blocked by google tool bar or any blocker?

Thanks in advance
DeveloperMind

penders

3:26 pm on Jan 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Windows that 'popup' as the result of a direct user action, such as clicking on a link (like you have), should generally be OK I would have thought. Popups that should be blogged are those that 'popup' as a result of merely opening the page etc.

Although, having said that, I think IE can be configured to block ALL popups - although it is not the default setting. The Googlebar may be similar?

Bare in mind that the code example you give will not work if JS is disabled. Ideally you should set the href to point directly to the file and activate the 'popup' in the onclick event, that way the file can still be accessed if so desired:

<a href="mypopupfile.html" onclick="OpenPopUp();return false;">Click to open popup</a>

If JS is enabled, they see the popup, otherwise the file opens in the browser.

DeveloperMind

4:39 pm on Jan 6, 2007 (gmt 0)

10+ Year Member



Thank you very much penders,
This is really helpful information.