Assuming that:
will work if you are already on the myPageWithDivs.htm page, then simply add this script to the end of the myPageWithDivs.htm page, right before its closing </body> tag:
Code:
<script type="text/javascript">
(function(){
function getQval(n) {
if(typeof n !== 'string'){
return null;
}
var r = new RegExp('[?&;]' + n + '=([^&;#]*)'), m = location.search;
return (m = r.exec(m))? unescape(m[1]) : null;
}
var div = getQval('div');
if(div){
changeIt(div);
}
})();
</script>
Now a link from any other page may open div9 with a link like so:
Code:
<a href="myPageWithDivs.html?div=div9">Open Div 9 on myPageWithDivs.html</a>
Same thing with other divs, just use - say, div8 or div2 instead of div9 there in the href.
If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
Bookmarks