Dynadot Black Friday and Cyber Monday 2026: save more on domains. See our sales.

Javascript

SpaceshipSpaceship
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
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
Appraise.net

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

New: watch any domain
You can now watch domains on NamePros. We check each one and notify you when something changes. Search for a domain and press Watch on...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back