1

How is it possible - in jQuery- to fetch the URL when clicking inline links like following?

http://domain.com/#!/?model=ford
http://domain.com/#!/?color=blue

Following code grabs when you reload the whole browser, but not when you click the "inline links"

$(location).attr('href');

A site using the technique Im looking for is the following: http://www.modezine.com/se/#!/?category=women Try pressing the different colors and look at the URL and the content being reloaded without browser reload.

Fredrik
  • 627
  • 6
  • 14
  • 28

1 Answers1

1

If you look in firebug while clicking the different colors, the call is made via AJAX. Grabs the desired URI content and pushes it into place (this technique will not refresh the page, but the URL is "prettyfied").

So my answer is : go for AJAX.

Don't miss this link https://developer.mozilla.org/en/Ajax

Roko C. Buljan
  • 196,159
  • 39
  • 305
  • 313
  • Thanks for the answer it put me in the direction of finding this thread on stackoverflow: http://stackoverflow.com/questions/406192/how-to-get-the-current-url-in-jquery with this neat solution: $(window).bind('hashchange', function() { .. work .. }); – Fredrik May 13 '12 at 20:59
  • Thanks was about to write it. Nice research. – Roko C. Buljan May 13 '12 at 21:06