Fog Creek Software
Discussion Board

Javascript Compatibility

I am doing a really basic photo site, and would like to use Javascript for pop-up windows (enlarging photos). I am debating, however, if it's worth it due to compatibility issues:
1) I know that these days almost everyone has a javascript-compliant browser. But I feel like just on principle I want to make it as compatible as possible. Is it worth my trouble to try and do things in a non-javascript way, or am I being ridiculous?
2) What about people who have Javascript turned off in their browser, or who block pop-ups -- does anyone have real-world experience with sites they've done where users reported these kinds of problems?


Jordan Lev
Thursday, July 15, 2004

"1) Is it worth my trouble to try and do things in a non-javascript way, or am I being ridiculous?"

You're being ridiculous.  Every browser can do the basic Javascript necessary for a image popup.  I do it all the time on my site (

"2) What about people who have Javascript turned off in their browser, or who block pop-ups"

Popup's based on a user-click are generally not blocked -- I have popups blocked and I still get the large images from my site.  Those people who have Javascript disabled a used to have 75% of the internet not work for them -- so don't worry about them.

Almost Anonymous
Thursday, July 15, 2004

Go with the JavaScript,
Put a text which says you need JavaScript turned on to experience this site ... and images on ;)

If you get compalints, switch take the script down, and use a HTML solution.

I have had problems with using JavaScript once in an CMS solution, the SysAdmin in the company refused to accept .js files through the firewall.
I ended up with putting all the scripts in server include files instead.


just testing
Thursday, July 15, 2004


If your not using really large images have a look at whatever Image_Swap script you can find. It eliminates the need to open an additional window. The bit that I use I found on WebMonkey but there're a lot of sites with this type of script.

Perpetual Newbie II
Thursday, July 15, 2004

Or consider:

<a href="bigPhoto.jpg" onclick="return popupPhoto(this)">Big photo</a>


function popupPhoto(link)
  var w =, ... );
  return false; // stops the <a> tag navigating

"Normal" users see the popup window - if they're JavaScript-challenged then they simply browse to the image directly.

Of course this assumes that there's not a lot going on in the popup window so the non-JS users are not missing much - therefore your mileage may vary.

Duncan Smart
Thursday, July 15, 2004

Maybe I'm just really anal but sites that use javascripts to pop up windows for links really bug me.  I often use right-click->open in new window when I want something in a new window... if the link is using javascript to force it to open in a new window then this just results in a javascript error and some swearing from me.  What's wrong with using the "target" tag - isn't that what it's there for?  The only reason that I can see for using JavaScript instead is to switch off browser features in the process - which is another annoying thing that authors do.  How many times have you tried to read something in a popup but can't because the author decided that no-one would need to resize the window or use a scrollbar?

(Ok, after reading that back, I'll admit that I am anal but my point still stands).
Thursday, July 15, 2004

Jordan, have a snoop around
you'll find somethind that works for you.

Perpetual Newbie II
Thursday, July 15, 2004

crap 'something'

Perpetual Newbie II
Thursday, July 15, 2004

Blech. Why not just open the image blow-up in the main window? There's this thing called the Back button ... I'd pay money for a browser that disabled click-popups (as oppposed to auto-popups) and the friggin target tag.

The programmers here will tell you to use JavaScript because You Can. As a user, I implore you to choose not to. Clicking closed a bunch of popup windows is way harder than click Back a bunch of times.

Opening links in new windows should be reserved for Web forms where, for example, the user wants to read help text while clicking and skipping a long series of checkboxes. (And even this wouldn't be neccesary but for badly designed browsers and Web apps)

R Tate
Thursday, July 15, 2004

"Blech. Why not just open the image blow-up in the main window?"

Why have colors on a webpage...  black on white is the easiest to read.  Images take to long to load, who needs them!  Fancy layouts are just annoying.

Anyway, we do the image-link-popup on our site.  The window that opens is exactly the size of the image, and if you click anywhere, the window closes automatically.  So users can quickly click from one image to the next.  And it looks much much better.

I think if I polled my visitors, they'd prefer it that way to what your suggesting.

Almost Anonymous
Thursday, July 15, 2004

Agreed on the issue of supporting "Right Click -> Open In New Window".

Using <a href="foo_big.img" target="someWindow" onclick="openPopUp(); return false;">...</a> should solve all of these issues.

If the user clicks the link with JavaScript enabled then the pop-up appears as intended with whatever settings are specified.  I feel that scrolling and resizing should probably not be turned off, but I can see value in removing the address bar and tool bar in some situations.

If the user clicks directly with JavaScript disabled it stills opens in a new window, but with all the bars in place.

If the user explicitly opens a new window via the context menu, then it still shows the image, but with all the toolbars in place.

Thursday, July 15, 2004

Take them to another page. Those popups annoy me too, chiefly because they are so slow. You can actually feel the browser actually spawn the new window.  Especially when I am on a dual monitor and the pop up comes up on the other screen.

Matthew Lock
Thursday, July 15, 2004

Mozilla/FireFox has the TabBrowser extension that lets the user force a "new window" to a new tab instead (and you can define exceptions for the rare few cases in which you do want a popup window).

Try it and you won't go back.

This and others at

Ori Berger
Friday, July 16, 2004

User initiated (onClick, for example) are never blocked as they are assumed to be a portion of the application.

If you want compatibility, stay away from references like "document.all".  Just make it compatible with Mozilla (one of the most standards compliant browsers) and it should work with IE with zero modifications.

I'm working to convert all of our webapps at work from IE-specific to browser-independent because some of our clients are switching browsers for security issues.

Friday, July 16, 2004

Almost Anon, you are veering into hyperbole. Images bring a clear, definite benefit to Web pages, and color lets you distinguish links from regular text and can have clear usability benefits if used in select other cases. Pop-ups are not a leap forward in the same sense, if at all.

As I said, they have their place, but as with images and text color are quite often mis-used. Navigating to a new Web page should not open a new window, although of course I would not try and stop you ;->

Ori, thanks so much for the extension reference, I was just thinking I should go looking for something like that. A new tab isn't what I want but it sure beats a whole new window.

R Tate
Friday, July 16, 2004

*  Recent Topics

*  Fog Creek Home