Jump to content

jQuery Question


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...}

Edited by ApocalypeX
Link to post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...