Open external links in a new window in one line of jQuery
I have been against opening new browser windows because a user can choose to do this on their own. There are several ways they can do this like middle middle clicking or right clicking for a contextual menu. I also wrote about it a few years ago as part of my 12 bad website practices. I’m a little more open to this practice now; I believe the choice to open external links in a new window also depends on your website and your taget audience. I constantly middle click myself, because often when you visit a link embedded in article you fully intend on coming back to the source article after taking a peek. Regardless of whether it’s right or wrong, here is a super easy way to make all external links open in a new window using jQuery.
Keep Reading
Clearing the jQuery animation queue
Ever see sites where a jQuery animation happens over and over when you rollover or click it multiple times. It’s almost as if the animations are stacking on top of one another in a queue and executing one by one, and guess what? That’s exactly what’s happening. Not to worry though, there is a simple and easy way to fix this.
Using custom CSS and Javascript in WordPress posts
Today while writing The secrets to using custom web fonts I ran into a bit of a snag. I wanted to show several CSS driven examples within the post, but the WordPress editor would remove anything I added. I have dealt with this issue in the past, usually in a clunky manner or even hosted separate example pages. This time though I really wanted the font examples to show up within the actual page content and I didn’t want to add more styles to my WordPress theme. The method I used is remarkably easy and can be implemented in about two or three minutes.
The secrets to using custom web fonts
If you are a web designer then you’re already fully aware of the limitations surrounding the usage of fonts on the web. For years we have basically had two reliable options, use a standard web based font that is included on most operating systems with a few fall back fonts, or images. For headlines, custom fonts and anything fancy images were the only way to go, but that’s all about to change.
Doing JavaScript pop-up windows the right way
Some would argue there is no right way to do a JavaScript pop-up since it disrupts the natural flow and usability of the web. I would tend to agree, but like all things web, there are exceptions to this rule and it may not be your choice anyway. That said there definitely is a very wrong way to do a JavaScript pop-up, and unfortunately there are literally hundreds of tutorials showing you how to do it the wrong way and even more websites implementing it wrong.
jQuery really can change the way that you write JavaScript!
I recently started playing around with two JavaScript libraries, MooTools, and jQuery. After playing with MooTools for a long time and getting frustrated, I switched to jQuery. This does not mean MooTools is bad, I am no JavaScript expert and there are a lot of very nice MooTools examples on their site.
At work I write a lot of JavaScript validation in forms, and it can get very tedious. I like writing my own code, but I’ve never really liked JavaScript as much as other languages and in today’s world of ever changing technologies and browsers I finally thought why re-invent the wheel; someone has probably done this better than me already. Combine that with the fact that the form I was working on and my JavaScript was becoming particularly unwieldy, so I decided try out one of these highly praised JavaScript Libraries.
After downloading jQuery I quickly realized I would need a plugin. A quick search revealed many, many plugins, including a validation plugin called “Validation” of all things. The learning curve for jQuery and the plugin was several hours, but after setting it up I quickly began to see the power using a JavaScript library. I am now a jQuery convert.
Want to see who else is using jQuery? The list is quiet impressive. As another blogger said, if it’s good enough for them, it’s good enough for me.