Vikrant Azad schrieb:
> Hi Klaus
> 
> Thanks for all the great work you are doing on this forum especially,
> besides ofcourse with the plugins (Tab plugin I am really impressed with)
> and now that you have joined the jquery team I see more goodies coming.
> 
> I am also trying to do someting like this. I want to use your history plugin
> in joomla CMS. I can load the pages by ajax but the back functionality was
> lacking. After seeing your plugin I thought of redoing this Ajax loading of
> my joomla website.
> 
> the links in joomla are like index.php?option=content.....
> to load a page with ajax I need to replace index.php with index2.php and I
> was doing in with onclick handler like this
> $("a").click(function(){
>       
>         var url=this.href.split('/');
>               
>         var link=(url[url.length-1]);
>         var linkid=(link.replace(/index/, "index2")); 
>        
>           $("#mainbody").fadeOut().hide().load(linkid).fadeIn();
>           return false;
>     });
> 
> which works however without back functionality.
> Now I want to use your history plugin but I cant figure out how. I played
> with it a bit but everytime I get it to load a page, it somehow keeps
> reloading the page continuously.
> 
> Can you please guide me as to how I can do it correctly. basically I want to
> dynamically convert every link on click from index.php/.... to
> index2.php/.... and then load this page by AJAX along with the hash
> appending with it so that I can use back function of your plugin.
> 
> thanks
> vik

Vik, something like this should work (requires jQuery 1.1):

$('a').attr('href', function() { return this.href.replace('index.php', 
'index2.php'); }).remote('#mainbody');
$.ajaxHistory.initialize();

Unfortunately, the history plugin doesn't support effects for 
showing/hiding content. But that may be a nice addition. Let me know.


-- Klaus

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to