NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page again, more IE headaches...

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 05-23-2006, 03:29 AM THREAD STARTER               #1 (permalink)
NamePros Member
 
monty's Avatar
Join Date: Jun 2005
Location: Hat Yai, Thailand
Posts: 165
monty is an unknown quantity at this point
 



again, more IE headaches...


Damn, I hate this shitty software more everyday, pardon my French.

My issue is the next JavaScript function:

function menuHomeSwitch() {

????: NamePros.com http://www.namepros.com/programming/200191-again-more-ie-headaches.html
//set all items to #B5C4DD for background color
var temp = document.getElementsByName('nav')

for (var x = 0; x<temp.length; x++) {

temp[x].style.background = '#B5C4DD'
}
}

I have an serie of <td> tags with the name 'nav', and like the function shows, all I need to do is set the background colors to a different color. According to the DOM level 1 specification, this should work and it does so in all browsers, ACCEPT IE ofcourse.

Any suggestions before I kill myself?

tnx much!

-monty
monty is offline  
Old 05-23-2006, 07:54 AM   #2 (permalink)
JFS
NamePros Regular
 
JFS's Avatar
Join Date: Oct 2005
Location: Portugal
Posts: 800
JFS is a name known to allJFS is a name known to allJFS is a name known to allJFS is a name known to allJFS is a name known to allJFS is a name known to allJFS is a name known to allJFS is a name known to all
 



why don't you use CSS instead ?
__________________
Joćo Fernandes Silva
JFS is offline  
Old 05-23-2006, 11:39 AM   #3 (permalink)
NamePros Regular
 
Noobie's Avatar
Join Date: Feb 2006
Location: Montreal, Quebec, Canada
Posts: 324
Noobie is on a distinguished road
 



style.background-color='#whatever';
__________________
Goldkey.com is a scam
What's your BMI? | Timestamp Generator
Noobie is offline  
Old 05-23-2006, 02:32 PM   #4 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
Join Date: Feb 2006
Posts: 2,796
Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future
 


Autism Autism Autism Autism Autism Autism Autism
document.getElementsByName('nav').style.background = '#B5C4DD';

It'd be easier to use a class and some CSS.
Dan is offline  
Old 05-23-2006, 08:36 PM THREAD STARTER               #5 (permalink)
NamePros Member
 
monty's Avatar
Join Date: Jun 2005
Location: Hat Yai, Thailand
Posts: 165
monty is an unknown quantity at this point
 



Thanks for helping out everybody!

Originally Posted by Dan Friedman
document.getElementsByName('nav').style.background = '#B5C4DD';

It'd be easier to use a class and some CSS.
So, I tried this, I changed the function to:
????: NamePros.com http://www.namepros.com/showthread.php?t=200191

function menuHomeSwitch() {

//set all items to #B5C4DD for background color
document.getElementsByName('nav').style.background = '#B5C4DD'
}

And set the <td> tags class attribute to "nav", but still no joy, this doesn't in other browsers as well. Now, I didn't get much sleep last, so am I missing something here?

-monty
monty is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 10:16 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger