I have a site with ajax content uploaded. Now I want to implement a jQuery address plugin for a better user experience and search query scanning.
Using this line $.address.value($(this).attr('href')); change of address works, but how can I do history support, scanning, etc.?
There is something with $.address.change(function(event){...}); what should i do but what? I tried putting $("#content").load(toLoad,'',showNewContent) and other thousands of things in it, unfortunately, without results.
The documentation is really poor: http://www.asual.com/jquery/address/docs/
This is my code:
$('a:not([href^=http])').click(function() { var toLoad = $(this).attr('href') + " #ajaxedContent"; $("#content").fadeOut(600,loadContent); $("#load").remove(); $('#logo').append('<div id="load"></div>'); $("#load").fadeIn(100); $.address.value($(this).attr('href')); function loadContent() { $("#content").load(toLoad,'',showNewContent) } function showNewContent() {
The main implementation is as follows:
$.address.change(function(event) { // do something depending on the event.value property, eg // $('#content').load(event.value + '.xml'); }); $('a').click(function() { $.address.value($(this).attr('href')); });
Any help would be greatly appreciated. Thanks.
source share