PDA

View Full Version : get url anchor from main url


ohadpartuck
10-16-2012, 09:30 AM
Hi,
I have a template where I want to use an anchor from the main url like so:
<p align="center">
<iframe id="test" frameborder="0" scrolling="yes" height="1750" width="100%" allowtransparency="true" marginwidth="0" marginheight="0" src="">
</iframe>
</p>


so I'm doing something like this:
<script>
var url = window.location.href;
var anchor = url.split('#');
document.getElementById("test").src = "test.php?fkapp=1&u={vb:raw data}#" + anchor[1];
</script>

inside the template.

where anchor[1] will come from the main url like so:
www.mydomain.com/mypage.php#location3

It works ==> meaning the 'location3' passes to the iframe src, but It doesn't redirect inside the page
what am I missing?