Last week, John showed a technique for enabling a popup anchor to degrade gracefully for users who do not have Javascript enabled. Inspired by his technique, I decided to throw together a jQuery plugin that implements this technique, without having the event attached inline.
It weighs in at just under 1k minified, so it shouldn’t be too tough on your page weight. Feel free to download it and use it for any kind of project.
Usage
Include the plugin as you would any jQuery plugin (where “/path/to/file” is specific to your instance).
Next, put the HTML markup in place (of course the href, target and class can be what you want):
Open Google in a new window.
Then, just call popup() on the desired elements:
$(".popup-link").popup();
Additionally, you can provide the desired size of the popup window like so:
$(".popup-link").popup({
width: 320,
height: 240
});
Update
We have posted a new version of the plugin that addresses a small bug. The download link above takes you to the demo/download page which contains the new version. Read more about it on this page.


June 15, 2009 at 11:47 am
this rocks!
Thanks!
June 16, 2009 at 10:36 am
You could not find a plugin that already does this because any good developer understands that opening new windows or resizing the browser is an unprofessional practice. You do not own the browser, the user does.
June 16, 2009 at 11:33 am
http://rip747.github.com/popupwindow/
why reinvent the wheel.
June 16, 2009 at 2:30 pm
@Jason – Agreed. Generally speaking you should avoid opening windows. However, I think there are a few situations in which opening a window is acceptable. A “Terms of Service” window during registration, for example.
@tony petruzzi – Thanks for the comment and link. We didn’t see your take on the jQuery popup plugin after a quick search.
August 14, 2009 at 8:57 am
test this plugin for jquery popup
http://www.dieroboter.com/jQPOOOP
http://code.google.com/p/pluginjquery/
http://plugins.jquery.com/taxonomy/term/1759
September 1, 2009 at 4:12 pm
Glad you did reinvent the wheel- this plugin worked first time around unlike tony’s link previously.
November 10, 2009 at 6:51 pm
Jason, as a reader I found your comment lacks of value becuase it is not only wrong but also rude. Learn from JThomas about manners.