views:

1666

answers:

4

There are implementations for history.back in Micrososft AJAX and jQuery (http://www.asual.com/jquery/address/). I already have jQuery and asp.net ajax included in my project but I am not sure which implementation of history.back is better.

Better for me is:

  1. Already used by some large projects
  2. Wide browser support
  3. Easy to implement
  4. Little footprint

Does anybody know which one is better?

EDIT:

Another jquery plugin is http://plugins.jquery.com/project/history It is recommmended in the book JQuery Cookbook. This one worked well so far.

+6  A: 

One alternative to jQuery Address is the nice jQuery history plugin. There are also URL Utils.

Reference: AJAX History and Bookmarks.

Gregory Pakosz
I liked the screencast "AJAX History and Bookmarks". It uses URL Utils which is superceded by jQuery BBQ, but it is still a very good starting point.
Malcolm Frexner
Here is a decent article with links to jquery.pager.js, microtemplates.js, and jquery.ba-bbq.jshttp://stephenwalther.com/blog/archive/2010/04/08/jquery-asp.net-and-browser-history.aspx
Kris Krause
A: 

If you are building an ASP.NET application then using ASP.NET Ajax Framework gives you many advantages and a nice-simple API to use server-side.

Below you can find an example that uses Browser History with ASP.NET Ajax

Create a Facebook-like AJAX image gallery

Both have a wide range support in browsers. For me is easier to integrate Microsoft AJAX Framework in an ASP.NET page so again if you have an .aspx page it might be easier to work with ASP.NET AJAX

djsolid
A: 

If you don't need exactly AJAX, i.e. updating only parts of the site on request is sufficient for you, then you can use invisible iframe as target for loading generated HTML file containing only JS script that updates/resets "updateable" parts of the site. This is cross-browser solution and doesn't need address polling.

Example, but not in ASP: kociszkowo.pl (Polish site)

When you click there in the section icon and your browser supports javascript, link is modified before being fetched - target is changed to iframe and href is suffixed with .dhtml to inform server, that we're interested in a special version of the page. If you press Back in your js-equipped browser, then previously fetched iframe page is loaded from the cache. Simple, but requires some decisions at architectural level.

This link modification is irrelevant here, it's just the result of combining JS/non-JS world.

przemoc
A: 

In my experience, your best bet is using the same one that you have doing most (if not all) of your ajax calls. For instance, if you're using asp:UpdatePanel's, use the MS one - if you're using jQuery.ajax, use the jQuery history plugin. If you're doing a mix (which I've tried to avoid in my projects), I'd personally test with both and see which behaves better - if they both test fine, then it's a bit of preference. Some may argue the Microsoft one would have better support, but jQuery's history plugin may get more use and more mature.

http://msdn.microsoft.com/en-us/library/system.web.ui.updatepanel.aspx

http://docs.jquery.com/Ajax/jQuery.ajax#options

James Manning