Jump to content

jQuery Question


ColdEdge

Recommended Posts

Hello, I have a question. I seen many Cloud Hosting sites use jQuery for there primary choice not only that I seen this kind of urlshttp://sitename.com/photo169#photo/165Can I aks how can I load a page or something using # command with jQuery?
Essentially it's using location.hashhttp://www.w3schools.com/jsref/prop_loc_hash.aspI think what they do is they use the hash property as a "Javascript-like query" like PHP's ? url queries. They then write their own querying system. For example:
query = location.hash;switch(query){case "photo"://do something...}

Link to comment
Share on other sites

You can use the # with an anchor tag to focus on a specific part of the page. When you append that to the end of a URL, the page would load and then focus on that particular part of the page.http://www.w3schools.com/html/html_links.aspUsing the link that Apocalype X provided, if you need to, you can get just that part of the URL when the page loads.So yes, it's kind of like PHP, where a GET URL would like like this:www.somesite.com?link=hereand PHP could access it this way.$var link = $_GET['link'];except you are using Javascript to do it instead. As far as I know, it is not something specific to jQuery.

Link to comment
Share on other sites

Essentially it's using location.hashhttp://www.w3schools.com/jsref/prop_loc_hash.aspI think what they do is they use the hash property as a "Javascript-like query" like PHP's ? url queries. They then write their own querying system. For example:
query = location.hash;switch(query){case "photo"://do something...}

just a note, if you were going to build a conditional off the location.hash method, you would have to include the #, or remove it. i.e.
query = location.hash;switch(query){case "#photo"://do something...}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...