/    Sign up×
Community /Pin to ProfileBookmark

Java Script to enable pop up blocker

need to open a new tab via window.open. But when i try the below script, if the chrome or firefox browser blocked the popups, its not opening. How to tackle this situation. i.e. how to enable popup using javascript.

Here is my coding

var windowName = ‘userConsole’;
window.open(‘Redirect Url’, windowName, ‘width=1000, height=700, left=24, top=24
,scrollbars, resizable’);

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@rootJul 04.2014 — I just tried this in an HTML page I use to mess around with code [CODE]
x=window.open("about:blank","The cost","left=20,top=20,width=400,height=300,toolbar=0,resizable=1");
x.document.write("The cost is : ",cost);[/CODE]


The browser it was tried in was Chrome.

What you might want to try is to use a blank.html file on your server then set the new URL if you are navigating away from your domain.
×

Success!

Help @chethan 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 6.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...