| 7:34 pm on Jan 6, 2006 (gmt 0)|
Why do you care if it gets blocked? You don't like pop-ups.
| 10:16 pm on Jan 6, 2006 (gmt 0)|
|Why do you care if it gets blocked? You don't like pop-ups |
Next time please add some value to your post.
You have to make it user initiated. Meaning, the user has to click on something to make it open. If you just pop up a window without a user performing an action, those are the culprits that blockers feed on. Just about every blocker I've seen/used does a good job of letting user initiated clicks happen.
| 11:40 pm on Jan 6, 2006 (gmt 0)|
Could I get a code example of how to do it please?
| 11:41 am on Jan 7, 2006 (gmt 0)|
OR you can use the old trusted method: <a href="url" target="_blank"> which will also open it in a new window.
| 8:19 pm on Jan 9, 2006 (gmt 0)|
<a href="url" onClick="window.open('url','title','features'); return false;">
Fully valid and, most importantly, does annoy a user with JS disabled by making an end run around his settings. If the user has JS enabled and your popup doesn't get blocked, it runs the JS and opens the new window and returns false, so it basically cancels the click and the current page stays the same.
If the user has JS disabled, then it doesn't run the code that returns false, treats the click as a normal click and opens the "popup" as a regular page (which is what the user wants - that's why he's disabled JS).
If JS is enabled but the popup gets blocked, it still returns false and nothing happens, though in general, in Firefox at least, the popup will open (user-initiated) and if it doesn't, the user will get a notice asking if he wishes to make an exception for your excellent site.
| 9:46 pm on Jan 9, 2006 (gmt 0)|
I don't like that target=_blank is deprecated. Nice and clean code to deal with.
I still use it and it validates as transitional.
Works well with my 8-tracks too.
| 5:38 pm on Jan 10, 2006 (gmt 0)|
You may not like it, but... I used to feel the same way, but the logic is this:
- target="_blank" forces a client to open a new window.
- opening a new window is a client-side behavior that should be achieved with client-side scripting that can be controlled by the client (or user of the client) if desired.
- using HTML to do this mixes models and overrides client controls.
It is the rough equivalent of using HTML to control font size and font face, rather than CSS, but I think worse, actually, because it doesn't merely force a presentation on the user regardless of whether they have an overriding stylesheet, but actually forces a behavior on the user for which no current browser offers an override.