/    Sign up×
Community /Pin to ProfileBookmark

correct pop up window

What is the correct way to code for a pop up window? I have seen both ways. Both work on most browsers but Safari chokes and you must click twice to get it to work(on either code)

<a href=”homepage.asp” onclick=”javascript:window.open(‘newpopup.asp’, ‘name’, ‘width=750,height=350’); return false;”><img src=”pic” alt=”” width=”149″ height=”208″></a>

<a href=”#” onclick=”javascript:window.open(‘newpopup.asp’, ‘name’, ‘width=750,height=350’); return false;”><img src=”pic” alt=”” width=”149″ height=”208″></a>

or is there a completely different standard code that I am missing. I am looking for the best code that will work on the most browsers. Thanks!

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@fredmvOct 23.2003 — This is the correct way:&lt;a href="something.html" href="window.open(this.href, '', '');return false;"&gt;New window.&lt;/a&gt;However, I would actually not recommend opening new windows as it [url=http://www.diveintoaccessibility.org/day_16_not_opening_new_windows.html]destroys accessibility[/url]. ?
×

Success!

Help @bh3 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...