this code brabs the information after the '#' charecter:
var loc=document.location.href;
var information=loc.substring(loc.indexOf("#")+1,loc.length);
this is very handy to create a template page used for photographs etc..
i.e.
Page1.html
<a href="page 2.html#Pic1">Link to Pic1</a>
<a href="page 2.html#Pic2">Link to Pic2</a>
<a href="page 2.html#Pic3">Link to Pic3</a>
Page2.html
var loc=document.location.href;
var PicName=loc.substring(loc.indexOf("#")+1,loc.length);
and in the body of page2.html:
document.write("<img src=img/"+PicName+".jpg>");
Basically you dont have to make like about 50 individual pages for your online photo album. all ya gotta do is name your pics Pic1.jpg, Pic2.jpg, Pic3.jpg etc...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.