Results 1 to 10 of 10

Thread: Damn Pop-up blocker

  1. #1
    Join Date
    Jun 2006
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Damn Pop-up blocker

    A friend trying to view my site (with IE5 and I think XP,SP2) says he gets a "Pop-up blocked" message when he clicks on my links which look like this:


    <a href="#" onMouseOut="hideddrivetip()" onMouseOver="ddrivetip('&nbsp;show slide','#000078','72')" onClick="window.open('slides/03whatever.htm','500x333','width=500,height=333,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no')" style="TEXT-DECORATION: NONE"><font color="#AA0000">LINK</font></a>


    As you can see I'm using a DHTML Tooltip script from this place, and I'm being a bit fussy about the appearance of my LINK, but I really can't see why the Pop-up blocker has anything to do with my window.open command.


    To add to the hurt, my friend says his Pop-up blocker is off.


    Hayulp!

  2. #2
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    window.open does open a popup. If you want to use a DHTML popup I think there are several in the Dynamic Drive library.

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Well his popup blocker is evidently not off.

    This is exactly why popups shouldn't be used for important content.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,134
    Thanks
    44
    Thanked 3,231 Times in 3,192 Posts
    Blog Entries
    12

    Default

    Well, if friend's pop up blocker settings are set to the more aggressive end of the spectrum of choices, there isn't much you can do. But, if friend has Google tool-bar with, or just average settings, you might still be able to get it to work. Name your window a word, not a number. Change the href from "#" to "javascript:void(0);" and make the onclick event the first event listed for the link. Put the font tags outside the link, not inside it. Skip status=no, almost no browsers allow that live anymore. In fact, by simply specifying width and height, all those except resizable and possibly scrollbars default to no anyway. The event is onclick, not onClick.

    Window name (red):

    Code:
    onclick="window.open('slides/03whatever.htm','500x333','width=500,he
    As I say though, these measures won't overcome a really aggressive pop up blocker but, they will let you slip through in some cases where you otherwise would be blocked by less aggressive settings.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jun 2006
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Thanks again to ^you^ sir. Interesting stuff, even though I'm going for the DHTML opener I think. Is it generally better form to keep yer <font><b></b></font> type tags outside yer <a></a>'s then?


    While we're on the subject of the window attributes (directories=no,status=no,menubar=no,toolbar=no,resizable=no) - how do you kill the message bar at the bottom? I guessed "msgbar=no" and was wrong.

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,134
    Thanks
    44
    Thanked 3,231 Times in 3,192 Posts
    Blog Entries
    12

    Default

    The status=no would be it but, it doesn't work anymore due to security updates. Also, it is implied, so need not be listed - if any browser will allow it, simply not listing it will remove it from the pop up.

    I'm not sure about the font tag, bold tag, etc. These really shouldn't be used anyway, as they have been deprecated in favor of css style. The issue here though, is that you need to make as direct of an association between the anchor tag's event and the link trigger as possible. The operative condition being 'user activated'. IE can be particularly finicky about this.

    One thing I forgot to add is that you should also return false after your onclick event:

    Code:
    onclick="window.open('slides/03whatever.htm','mywin','width=500,height=333,scrollbars=no,resizable=no');return false;"
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Jun 2006
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Continued thanks sir.


    So forgive me, indulge me, I'd really like to understand this stuff rather than just use it badly and hope to get away with it.

    (i) How come status=no works locally? The message bar gets whipped off no trouble when I'm testing. How does my IE5 know the difference? It seems quite unfriendly to have taken such innocent choice away. (At least, I was going to use it innocently, purely aesthetically.)

    (ii) On what level does this case-sensitivity onClick / onclick matter? How wide and far? I've nabbed bits and pieces of code from all over the place, so there are <SCRIPT>s and things knocking about. Does onmouseover work?

    Sorry, too many little questionlets. I don't mean to take too much of your time, terse nutshells will do.

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    (i) How come status=no works locally? The message bar gets whipped off no trouble when I'm testing. How does my IE5 know the difference? It seems quite unfriendly to have taken such innocent choice away. (At least, I was going to use it innocently, purely aesthetically.)
    I'm sure you have the best intentions in the world, but alas, the browser cannot know this Only local files are trusted completely, and even then they aren't allowed to connect to the Internet lest they "phone home," as it were.
    (ii) On what level does this case-sensitivity onClick / onclick matter? How wide and far? I've nabbed bits and pieces of code from all over the place, so there are <SCRIPT>s and things knocking about. Does onmouseover work?
    HTML is case-insensitive. However, it's generally considered good style to use all-lower-case, especially since XHTML is not, and it will make updating the site to XHTML easier should that ever become feasible. Also, the DOM event is called "onclick", and the DOM (and Javascript) is case-sensitive. Thus, element.onclick will function in Javascript, while element.onClick will not, and using the same case for both the HTML attribute and the DOM property helps to avoid confusion.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. #9
    Join Date
    Jun 2006
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Hmm, interesting. And not a little scary, that link. Thanks.



    Gosh, this place logs you out pretty sharpish when you wander off, don't it.

  10. #10
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Gosh, this place logs you out pretty sharpish when you wander off, don't it.
    It has been commented on. I just use the auto-login feature.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •