Forum Moderators: open
works perfect for my requirements but the problem is once I clicked back from PageB (framed) to the PageA (The page that called PageB)
All the links of PageA are all javascript link (can be seen if hover the link)
<div id="X">
</div>
<div id="Y">
</div>
How can I make it in such a way that only the links in <div> Y are the only javascript link (will open in a framed page) and all other links of other divs are regular link. Thanks
<script type="text/javascript">
window.onload = function () {
var elList = document.getElementsByTagName('a');
var i;
for (i = 0; i < elList.length; i++) {
elList[i].href = "pageB.htm?s=" + encodeURI(elList[i].href);
}
};
</script>
<script type="text/javascript">
window.onload = function () {
var Y = document.getElementById('Y');
var elList = Y.getElementsByTagName('a');
var i;
for (i = 0; i < elList.length; i++) {
elList[i].href = "pageB.htm?s=" + encodeURI(elList[i].href);
}
};
</script>
See if that works.
<script type="text/javascript">
window.onload = function () {
var Y = document.getElementById('Y');
var elList = Y.getElementsByTagName('a');
var i;
for (i = 0; i < elList.length; i++) {
elList[i].href = "pageB.htm?s=" + encodeURI(elList[i].href);
}
};
</script>