Posts Tagged ‘Advanced JavaScript’

Fixing the back button for Ajax apps to enable bookmarking into history – jQuery, ASP.NET Ajax, YUI & other ways

Most of you might already be aware of the paradigm shift problem in ajax apps in terms of the browser back button not working out of the box.

The problem and some of the generic solutions to it is described in more detail in the following articles. Suffice is to say that by integrating ergonomic display features such as back and forward navigation, we can make it simpler and more intuitive for the end user to immerse into the richer internet applications (RIA) that we can now create:

Fixing the Back Button and Enabling Bookmarking for AJAX Apps

AJAX: How to Handle Bookmarks and Back Buttons, Advanced Example

Fixing the back button that AJAX broke

AJAX: How to Handle Bookmarks and Back Buttons

How to build a cross-browser history management system

Now here’s Microsoft’s effort in solving the problem with the help of ASP.NET AJAX library:

Enable Back button support in ASP.NET AJAX web sites – This is a server-centric solution that gets translated into client side history management code.

Managing browser history from client script

ASP.NET AJAX History Part 2: Client-Side

AJAX History and ASP.NET AJAX Preview 3

Client History Points in ASP.NET 3.5 Extensions

The link below is a Yahoo Developer Network effort in attending the issue:

YUI 2: Browser History Manager

Now onto the implementations by my most favorite JavaScript library (I would love to call it a Framework someday soon!) jQuery. There are tons of jQuery plugins that do this. All but one of them below uses address mangling technique in the form of page.aspx#5 to solve the problem. There are pros and cons for both the techniques as explicitly assigning mangled address like that helps in bookmarking. Whereas, if you don’t want to show the values you want to store in the history to the user, then hidden iframe technique below comes in handy:

jQuery BBQ: Back Button & Query Library

History/Remote – jQuery plugin solution for hijaxing links and enabling history

Restoring conventional page navigation to your javascript application with jQuery history plugin

jQuery History Plugin – Uses hidden iframe technique so that the address is not mangled with hash.

jQuery Address – Deep linking plugin – Supports Deep linking

History plugin

jHistory plugin

 

 

Advertisements

Advanced JavaScript Resources

JavaScript, being so simple to learn & use is one programming language which is not always given its proper due. I think the main reason for this is that most people who tries to undermine the language are greatly fooled by it’s simplicity. Although, it has its fare share of shortcomings but the kind of things it can accomplish is pretty amazing.  If you have any doubts, check Can Your Programming Language Do This? at Joel on Software.

There are raging and never ending debates as to whether JavaScript is even a true programming language or whether it is an object-oriented language at all but that’s beside the point.

IMHO, JavaScript does indeed exhibit object-oriented programming language features. As per Yahoo! Answers, there are two models of object orientation. One is based on classes as the templates from which to create objects (instances of classes), and the other relies on prototypes that are already objects and which can be cloned to create new instances. JavaScript (and others) takes the prototype approach.

In any case, today I am here to guide you towards few sources which should go a long way in giving you a good idea about what JavaScript is and what it isn’t. Statutory warning – most of them are of advanced nature :). So, here you go, look at these sources which might quench your thirst for advance level JavaScript:

JavaScript Execution Context, Closure, Eval and “this” Keyword

Javascript Closures

The Magic Eval

Quirksmode JavaScript Tutorials

Scope in JavaScript

Variable Scope for New Programmers

Code Conventions for the JavaScript Programming Language

The JavaScript Programming Language

Douglas Crockford: JavaScript Doesn’t Suck

JavaScript as a Functional Language

Functional JavaScript – Harnessing the power of the Function Object

Yahoo! User Interface Blog has these excellent resources:

Douglas Crockford, a senior JavaScript Architect at Yahoo! and introducer of JavaScript Object Notation (JSON) to the world, whose  JavaScript: The World’s Most Misunderstood Programming Language is a must read, had a go at clearing the common JavaScript misgivings for you folks out there:

YUI Theater: Douglas Crockford, The JavaScript Programming Language

Video: Douglas Crockford, “An Inconvenient API: The Theory of the Dom”

Video: Douglas Crockford, “Advanced JavaScript”

Learning JavaScript Programming Language through Video Lectures