Patching the failure of Back/forward button and bookmark in AJAX applications

Source: Internet
Author: User

Ideas and goals

Since the birth of Ajax, there are Back/forward button and the failure of the bookmark, I have generally advocated that a good AJAX application should not allow users to click the "Back/forward" idea, and use some way to provide the user with a bookmark that can record the directly generated page. Windows Live Local should be one of the best examples of this application, with its flexible interaction and a good interface that I had to brighten in the first moment.

Also, I've seen the idea of disabling the back button (which is really good for solving the problem), but it all seems to be a workaround, trying to avoid the pervasive problems of this AJAX application. It seems that Gmail can support the back button, but I was surprised to find that when I clicked back, I could not use forward, so it was not a successful solution to the problem. So can it be solved? Seems to have had a certain realization.

In fact, I had the idea of implementing my own solution because I saw his solution from Nikhil Kothari's blog (click here to see). He implements a Historycontrol control that can be used in conjunction with UpdatePanel in the page to achieve a certain level of support for the Back/forword button already in the bookmark. But as he said on the blog, this is just one of his prototype. After using his demo, I did find some problems (demos can also be downloaded from Nikhil's blog):

Historycontrol is a server control that must be used in conjunction with UpdatePanel and does not provide basic support for client applications in Atlas or even for common AJAX applications.

does not support Firefox (for some reason, I feel that supporting Firefox is easier to implement than IE when I try to do it myself).

When used in IE, from the back and forward Drop-down box, it can be seen that the title has become the "Empty Page."

Selecting a history jump in the back and forward drop-down boxes is not supported.

If you visit another site and then back, you do not support multiple fallback under IE.

Deployment trouble. In fact, I think it's strange that I have to run it directly in his project. Deployment to other projects or my space has problems, how can not find the reason, is estimated to be a file path problem, need to read his code carefully.

In short, the solution is still immature, but we have to be confident with Nikhil,atlas and Microsoft that the built-in support for Back/forward should appear in subsequent versions of Atlas.

So I think, I would like to implement a own bar, although I have been advocating software reuse, but if not find a mature solution, then it is time to play the initiative of the programmer. For my final implementation, it has the following features:

A lightweight JS solution. Although I write on the basis of Atlas, but only using the Sys.timer class in Atlas, it is easy to modify the JS code that is independent of any library.

Support IE and Firefox.

Simple support for the title text in the Back and forward dropdown box, in most cases without error. The cause of this problem of Nikhil is mentioned in the elaboration of my implementation. I solved the problem briefly, but did not design a complete support for the title issue of the perfect implementation. I have some ideas that seem very complicated and fail when I try.

Supports selecting a history jump in the back and ForWord dropdown boxes.

Bookmark support, users can easily add a page to the Favorites folder.

Easy to use and easy to deploy.

As for my 5th question in the implementation of Nikhil, I thought of some ways, but I still haven't solved it. Now, although there are ideas in mind, but still need to continue to try.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.