Unstoppable Domains โ€” Get your daily AI drops report

Javascript

SpaceshipSpaceship
Watch

Bryan792

Established Member
Impact
0
I have a javascript file which partially goes like this:

function setActiveStyleSheet(title) {
var i, a, main;
for(i=0; (a = document.getElementsByTagName("link")); i++) {
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
a.disabled = true;
if(a.getAttribute("title") == title) a.disabled = false;
}
}
}

This file is in the parent frame of a page with an iframe... I want it to make the change in the iframe but the :

document.getElementsByTagName("link")

always finds the 'link' s in the parent. How can I make it look for the 'link' s in the iframe???
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Is that the code you are using right there? Or did is that the default code?

If it's the default code, try changing where it says "link". I'm not sure if you have tried this or not.
 
0
•••
Try changing
document.getElementsByTagName("link")
into
window.frames['iframename'].document.getElementsByTagName("link")

Where 'iframename' is the name value of the iframe in question. Should do the trick.
 
0
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
CatchedCatched
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back