>
Download This Plugin | |
Download Elegant Themes | |
Name | jQuery.autoTarget for WordPress |
Version | 1.0.0 |
Author | Bill Knechtel |
Rating | 0 |
Last updated | 2014-12-18 09:43:00 |
Downloads |
20
|
Download Plugins Speed Test plugin for Wordpress |
Home page PageSpeed score has been degraded by 0%, while Post page PageSpeed score has been degraded by 0%
jQuery.autoTarget for WordPress plugin added 757 bytes of resources to the Home page and 745 bytes of resources to the sample Post page.
jQuery.autoTarget for WordPress plugin added 0 new host(s) to the Home page and 0 new host(s) to the sample Post page.
Great! jQuery.autoTarget for WordPress plugin ads no tables to your Wordpress blog database.There is a little gotcha when you're writing standards compliant code, but still want off-site links to open in new windows. XHTML 1.0 Strict deprecated the use of the "target" attribute. Early versions of HTML5 also had this deprecation, but have since brought it back. In either case, making sure the target attribute is set on every off-site link can be tedious.
Instead of going through the tedium of ensuring your target attributes are set, this jQuery plugin automatically scans all the links on a page, and sets the attribute for you (target="_blank") if the href attributes domain isn't the same as the domain the page is served from. Just to sweeten the deal, it also sets any offsite link to have a class of "external-link", so you can style offsite links in the manner of your choice. Easy-peasy. And it only weighs in at 272 bytes!
Just in case, the script does not touch any link that already has a target set, so if you're already doing something with the target attribute, this won't clobber your extant work.
If you need it, my jQuery plugin sans wordpress plugin is available at https://github.com/wknechtel/jQuery.autoTarget