xavier schrieb:
Hello,

I want to have an application that works both with and without ajax.
Eg: without ajax, I get /contentWithMenu and with ajax I .load /
contentonly into #content

  jQuery("[EMAIL PROTECTED]/]").bind("click",function(){
    jQuery("#main").load ("/xajax/"+this.pathname,{},function()
{this.style.opacity="1";}).fadeTo("slow",0.1);
    return false;
    });

I want to add that call to the history, so back and bookmarks work.

I'm looking at http://www.stilbuero.de/jquery/history/ and I don't
find a way to have separate urls for the normal link and for the ajax
one. I'm always tempted to blame the lack of documentation or feature
before having to admit that I'm blind, but feel free to fire ;)

In that case you're right. You can use the (yet) undocumented history method instead of remote...

You can attach a click handler to a link pointing to a hash and then enable history for that link. I'm using that for the tabs plugin:

$('whatever').bind('click', function() { /* do something */} ).history();

Don't forget to initialize history!


What I would like to have is a method to call from the click event to
add an #hash on the history, and a callback that I can customise so I
can load whatever needed based on the hash.

Does it make sense ? Is there a doc on the history plugin I missed or
another plugin that I missed ?

On the other history solutions I found (outside of jquery), you needed
to install an empty html that would be used with a iframe.Is it the
same here ?

Yes, for IE an iframe is required to hack history support, but I somehow managed to get rid of the blank HTML. On the other hand it may be required if you use the plugin on https pages to avoid a security warning. I haven't tested that yet due to lack of possibility.


-- Klaus

Reply via email to