How to use browser back-button functionality with JavaScript

Use jQuery BBQ plugin in combination with hash change plugin to listen for window has change events.

Let’s assume that you have a button with an ID of ‘button’. Let’s assume it does something useful like close a pop-up but it can do anything really.

e.g.

What’s with the Array.join(‘’) method?

Well I learnt from Google that this method is faster than concatenating a string with ‘+’. I’m always learning new ways to write better code.

Recommended reading

https://developer.mozilla.org/En/DOM/Window.location

Advertisements

One thought on “How to use browser back-button functionality with JavaScript”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s