help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Medical Watch

    help

    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


  • Grant Wagner

    #2
    Re: help

    Medical Watch wrote:
    [color=blue]
    > 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[/color]

    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="functi on1();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.

    --
    Grant Wagner <gwagner@agrico reunited.com>
    comp.lang.javas cript FAQ - http://jibbering.com/faq

    Comment

    Working...