help

M

Medical Watch

Can anyone help me on this:
I want to be able to open my paypal "view shopping cart" window with.
window.open(url, cartid,window attrb) but it gets blocked by the popup
blockers. window size is 740X400. is there any way to avoid popup blocker?
or do i need to open the full screen size window with form.post.
Thanks
 
G

Grant Wagner

Medical said:
Can anyone help me on this:
I want to be able to open my paypal "view shopping cart" window with.
window.open(url, cartid,window attrb) but it gets blocked by the popup
blockers. window size is 740X400. is there any way to avoid popup blocker?
or do i need to open the full screen size window with form.post.
Thanks

No, there is no way to avoid popups blockers. They block popups, that's what
they do, if there were a way around them, they would have no reason to exist.

Most popup blockers will not block new windows created as the direct result of
a user action (but some will, some will also open the new "window" in a
separate tab, or in the same window as the current document).

So, you could try to re-write your code to make your window.open() the direct
result of a user action:

<a href="#" onclick="function1();return false;">...</a>
<script type="text/javascript">
function function1() {
// this line will probably work, even in the presence
// of most popup blockers (but not all popup blockers)
window.open(...);
// this line will probably not work in a lot of popup blockers
window.open(...);
// the window.open(...) requested in function2()
// will almost certainly not work in almost all popup
// blockers, it is "too far away" from the original user action
function2();
}
function function2() {
window.open();
}
</script>

Alternatively, you can hope the user agent will react properly to:

<form ... target="_blank">

But your best bet is to re-think your workflow to remove the need for a new
window.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top