Plugins

The plugins site is currently in development.

We've been looking to provide a higher-quality, spam-free experience at the plugins site for some time, and a major error on our part forced us to shut down the current site before we could put the new one in place. We are developing a new site, and you can follow along with its development on GitHub. For more information about this transition, including steps you can take as a plugin author to prepare, please read our post about what's going on.

href


Steal HREF

Steal href is jQuery-plugin that lets you take the href of the first anchor inside that element and go there when the element is clicked. This is useful for example when you have a menu of some sort that consists of a list with li-elements. Inside each li is an anchor with the link. If you want to make the entire li clickable instead of just the link inside the li, just steal the href :)

UrlFavicon

UrlFavicon

Description

My first plugin, I decided to make a plugin which prepends the favicons of websites linked to on the page to their respective parent elements.

So, for example if you had the following;

<a href="http://www.google.com/">Google</a>

Then the net result after calling the plugin would have the favicon for Google prepended internally as an image tag to the link, or if the favicon couldn't be found then a fallback would be used instead.

However, me being me led me to expand upon this quite a bit more with quite a few configuration possibilities included.

Usage

Assuming you want to apply the favicon to every link on your site, with the default configuration then the below will suffice. Please note that all Urls which are found by the plugin must begin with "http".

$('a').urlfavicon();

But if you want to change some settings, then perhaps these could interest you...

urlParser

This plugin contains urlParser class and $.urlParser object of this class suitable for parsing URLs.

Properties
* $.urlParser.protocol. Protocol part (i.e. "html:", "file:", "ftp:")
* $.urlParser.host. Host part (i.e. "jquery.com")
* $.urlParser.path. Path (i.e. "/mysection/mypage.html")
* $.urlParser.parameters. Parameters list of type Object
* $.urlParser.anchor. Anchor part (i.e. "#start")

Methods

* $.urlParser.parse(string url). Parses passed URL, changing protocol, host, path, parameters, anchor accordingly. Returns object of urlParser class.
* $.urlParser.assemble(). Assembles URL string from parts and returns it.
* $.urlParser.setBaseUrl(string url). Changes URL base.
* $.urlParser.resetBaseUrl. Reset url base to current document URL.

Examples
* $.urlParser.parse('http://jquery.com/docs/').host will return "jquery.com"
* $.urlParser.parse('/docs/').host will return current host

EZJax - AJAX/AHAH Dynamic Content Loader

While jQuery simplifies AJAX (or more accurately AHAH) via the .load method - the EZJax plugin simplifies upon that by allowing association of a class with a standard link to create a dynamic content loader that is not only simple to setup and build upon, but also SEO-Friendly as it leaves the HREF intact allowing the dynamic content to be crawled and indexed.

EZJax also allows for slide/fade effects when loading the data (with/without easing).

The following code would dynamically load the document "somepage.hml" into the designated region, yet still be crawlable by search engines

<a class="ezjax" href="somepage.html">Link</a>

The script is only ~2K, and has been tested and runs on IE6+, FireFox, Safari, and Opera

loadpage

Loads a new url with or without browser history.
jQuery.loadpage('http://www.example.com', true); // with history
jQuery.loadpage('http://www.example.com', false); // without history
jQuery.loadpage('http://www.example.com'); // with history as default