JQuery Address - Deep linking and states?

There is nothing in this code that reads the url when you first load a page. If you type in the address bar 'test.com/test.html?page=entry' then you need to load in the content at page load, when the hash is manually changed, and on click events abishaigray.com/jquery.address.php $(function() { var content = $("#content"); var loadUrl = function(url) { content. FadeOut("slow", function() { content.

Load(url + " #content > *", function() { content. FadeIn("slow"); }); }); }; $("a. LoadUrl").

Live('click', function(event) { event.preventDefault(); $.address. Parameter("page", $(this). Attr("href")); }); $.address.

Change(function(vars) { var page = $.address. Parameter("page"); if (page) { loadUrl(page); } }); }) I took advantage of the $.address. Change event.In this way, anytime you update the url or when a user first arrives the content will be reloaded.

There is nothing in this code that reads the url when you first load a page. If you type in the address bar 'test.com/test.html?page=entry' then you need to load in the content at page load, when the hash is manually changed, and on click events. abishaigray.com/jquery.address.php $(function() { var content = $("#content"); var loadUrl = function(url) { content.

FadeOut("slow", function() { content. Load(url + " #content > *", function() { content. FadeIn("slow"); }); }); }; $("a.

LoadUrl"). Live('click', function(event) { event.preventDefault(); $.address. Parameter("page", $(this).

Attr("href")); }); $.address. Change(function(vars) { var page = $.address. Parameter("page"); if (page) { loadUrl(page); } }); }); I took advantage of the $.address.

Change event. In this way, anytime you update the url or when a user first arrives the content will be reloaded.

I have an inkling that I have to use $.address. Change at some point, but I have no idea how to implement it. Do you have a simple example to illustrate that?

Thanks a bunch :) – teddyrised Jun 22 at 17:37 Sure, see below. $.address. Change(function (vars) { alert('the url changed!'); }); Also, read through the jQuery Adress Docs – Abishai Gray Jun 22 at 18:03 Thanks.

I read through the docs and also the examples a few days ago, but still struggling to understand how it works. I have an example here that illustrates how $.address.change() works - jsfiddle.Net/5L6Ur/9 However, what bothers me is how can I navigate the user to the correct state when they enter a state-specific URL? I'd expect some regex, but haven't found anything in the examples thus far.

– teddyrised Jun 22 at 18:53 Thanks. I saw the example, and I have a few questions... I hope you really don't mind me bothering you. When I viewed the source code, it seems that the hyperlinks in the example go by "jquery.

Address/p1. Html". Why does it start with "jquery.

Address"? One more question. What does $.address.

Parameter("page", $(this). Attr("href")); actually do? – teddyrised Jun 22 at 19:22 1 No problem.

The hyperlinks contain "address. Jquery" because that's the folder they're in. It has nothing to do with jQuery.

It's just a URL. The $.address. Parameter method allows you to get or set querystring variables.

So, I'm setting a querystring variable ("page") to the links href. – Abishai Gray Jun 22 at 22:48.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions


Thank You!
send