Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

Javascript

Namecheap AuctionsNamecheap Auctions
NamecheapNamecheap
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
Close
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
Close
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
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back