Tutorial :how to use url and jquery



Question:

i wanted to know how do you get

http://wesitename.com#overall  

How to make a div show when the link is #overall ?


Solution:1

If the div has an id with the same name, then this should work:

$("#"+location.hash).show();  

location.hash will get you the hash-value of a url.


Solution:2

use window.location. On the onLoad event of the page, parse everything after "#" in window.location.toString(), and act accordingly.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »