I was wandering that if I could change the href attributes of all the links that are displayed within an IFrame. I had seen this system on many of the proxy site.
Please if anyone can provide me the code, I would be very grateful.
I was wandering that if I could change the href attributes of all the links that are displayed within an IFrame. I had seen this system on many of the proxy site.
Please if anyone can provide me the code, I would be very grateful.
Well actually you can, here is an example:
http://jsfiddle.net/2XXxW/4/ as example how it works
var ifrmame = document.getElementById('iframe');
var a = ifrmame.contentWindow.document.getElementsByTagName('a');
for (var i=0;i< a.length;i++) {
a[i].href = 'URL';
}
but iframes have to be the same origin, otherwise you cant access it for security reasons