help

Discussion in 'Javascript' started by Medical Watch, Dec 3, 2004.

  1. 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
    Medical Watch, Dec 3, 2004
    #1
    1. Advertising

  2. Medical Watch

    Grant Wagner Guest

    Medical Watch wrote:

    > 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.

    --
    Grant Wagner <>
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Grant Wagner, Dec 3, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?dHJlbGxvdzQyMg==?=

    HELP! HELP! HELP! Opening Web Application Project Error

    =?Utf-8?B?dHJlbGxvdzQyMg==?=, Feb 20, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    761
    =?Utf-8?B?dHJlbGxvdzQyMg==?=
    Feb 20, 2004
  2. Harvey
    Replies:
    0
    Views:
    692
    Harvey
    Jul 16, 2004
  3. Harvey
    Replies:
    1
    Views:
    835
    Daniel
    Jul 16, 2004
  4. =?Utf-8?B?S2ltb24gSWZhbnRpZGlz?=

    HELP - HELP - HELP

    =?Utf-8?B?S2ltb24gSWZhbnRpZGlz?=, Mar 9, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    678
    Eliyahu Goldin
    Mar 9, 2006
  5. Buster

    Help, Help, Help

    Buster, Oct 4, 2003, in forum: Java
    Replies:
    3
    Views:
    470
    Saager
    Oct 30, 2003
Loading...

Share This Page