RE: OT: Javascript browser compatibility question.
Jeff: Barring a browser bug (which is certainly possible), the likely culprit is a slight logic error with the JavaScript code. If you post the relevant code, I'm sure the list can review it for you. As to alternative ways of doing it, you might want to try change the cell's Class instead of actually changing a style. This is more CSS-compliant and, via CSS, much easier to modify later down the line. For example, you might have the following CSS: TD { background-color: #006600; } TD.Highlighted { background-color: #FF; } and the following JavaScript code: document.getElementById(CurrentHighlightedCell).className = ''; document.getElementById(NewHighlightedCell).className = 'Highlighted'; This way, should you ever decide to change the color of the highlighted or non-highlighted cells, you just have to change a couple of lines in the CSS file(s). -- Mosh Teitelbaum evoch, LLC Tel: (301) 942-5378 Fax: (301) 933-3651 Email: [EMAIL PROTECTED] WWW: http://www.evoch.com/ Jeff W wrote: > It appears that BOTH my example and the new.backgroundColor > example work and don't work... > > As if you couldn't tell this is a background cell changer. ...and > this code is firing on the ONCLICK of each cell :) Here is the weirdness... > > Say I have 3 cells wide table... Each named menu_item1, menu_item2 and > menu_item3 respectively. This code reverts the previous cell to > the original cell color and is part of the code to chage the newly clicked > cell to a different color.. > > document.getElementById > (CurrentHighlightedCell).style.backgroundColor='#006600'; > > Say I click through each cell consecutively. menu_item1, menu_item2 and then > menu_item3 it changes each cell to the new color and the code above > CORRECLTY changes the color back on the previous cell. That works perfect. > > Now the weirdness.. Say I click on menu_item3, it changes menu_item1 back to > the original color fine... but then I click on menu_item2, it DOES NOT > change the color back on menu_item3 using the above code. I double checked > and the variables are correct.. Very odd... IS there another DOM way to > reference this? ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:214611 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: OT: Javascript browser compatibility question.
Well isn't NS6.1 odd It appears that BOTH my example and the new.backgroundColor example work and don't work... As if you couldn't tell this is a background cell changer. ...and this code is firing on the ONCLICK of each cell :) Here is the weirdness... Say I have 3 cells wide table... Each named menu_item1, menu_item2 and menu_item3 respectively. This code reverts the previous cell to the original cell color and is part of the code to chage the newly clicked cell to a different color.. document.getElementById (CurrentHighlightedCell).style.backgroundColor='#006600'; Say I click through each cell consecutively. menu_item1, menu_item2 and then menu_item3 it changes each cell to the new color and the code above CORRECLTY changes the color back on the previous cell. That works perfect. Now the weirdness.. Say I click on menu_item3, it changes menu_item1 back to the original color fine... but then I click on menu_item2, it DOES NOT change the color back on menu_item3 using the above code. I double checked and the variables are correct.. Very odd... IS there another DOM way to reference this? Jeff On 8/11/05, Jeff W <[EMAIL PROTECTED]> wrote: > > I'll try the backgroundColor and give that a whirl... > Thanks, > > Jeff > > On 8/11/05, Charlie Griefer <[EMAIL PROTECTED]> wrote: > > > > if it's a literal ID value, then yes, he'd need quotes. I'm guessing > > it's a variable. > > > > Try backgroundColor (note the casing) instead of background. > > > > On 8/11/05, Jim Campbell < [EMAIL PROTECTED]> wrote: > > > Does it matter if you put the element ID in quotes? > > > > > > getElementById("CurrentHighlightedCell")... > > > > > > - Jim > > > > > > Jeff W wrote: > > > > > > >Can anyone tell me WHY this won't work in NS6.1 but work fine in > > ie5-6, > > > >firefox and NS8?? > > > > > > > >document.getElementById > > (CurrentHighlightedCell).style.background='#006600'; > > > > > > > >CurrentHighlightedCell is a variable that contains the current id of > > the > > > > background color I am changing. > > > > > > > >Thanks.. > > > >Jeff > > > > > > > > > > > > > > > > > > > > > > ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:214594 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: OT: Javascript browser compatibility question.
I'll try the backgroundColor and give that a whirl... Thanks, Jeff On 8/11/05, Charlie Griefer <[EMAIL PROTECTED]> wrote: > > if it's a literal ID value, then yes, he'd need quotes. I'm guessing > it's a variable. > > Try backgroundColor (note the casing) instead of background. > > On 8/11/05, Jim Campbell <[EMAIL PROTECTED]> wrote: > > Does it matter if you put the element ID in quotes? > > > > getElementById("CurrentHighlightedCell")... > > > > - Jim > > > > Jeff W wrote: > > > > >Can anyone tell me WHY this won't work in NS6.1 but work fine in ie5-6, > > >firefox and NS8?? > > > > > >document.getElementById > (CurrentHighlightedCell).style.background='#006600'; > > > > > >CurrentHighlightedCell is a variable that contains the current id of > the > > > background color I am changing. > > > > > >Thanks.. > > >Jeff > > > > > > > > > > > > > > > ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:214591 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: OT: Javascript browser compatibility question.
Its a variable.. On 8/11/05, Jim Campbell <[EMAIL PROTECTED]> wrote: > > Does it matter if you put the element ID in quotes? > > getElementById("CurrentHighlightedCell")... > > - Jim > > Jeff W wrote: > > >Can anyone tell me WHY this won't work in NS6.1 but work fine in ie5-6, > >firefox and NS8?? > > > >document.getElementById > (CurrentHighlightedCell).style.background='#006600'; > > > >CurrentHighlightedCell is a variable that contains the current id of the > > background color I am changing. > > > >Thanks.. > >Jeff > > > > > > > > ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:214590 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: OT: Javascript browser compatibility question.
Who you hope doesn't subscribe to this list.. ;) On 8/11/05, Ray Champagne <[EMAIL PROTECTED]> wrote: > Barney Boisvert wrote: > > NS6 was a bastard that didn't work. > > He he, I have an uncle like that. > > Ray -- Barney Boisvert [EMAIL PROTECTED] 360.319.6145 http://www.barneyb.com/ Got Gmail? I have 50 invites. ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:214588 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: OT: Javascript browser compatibility question.
Barney Boisvert wrote: > NS6 was a bastard that didn't work. He he, I have an uncle like that. Ray ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:214587 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: OT: Javascript browser compatibility question.
if it's a literal ID value, then yes, he'd need quotes. I'm guessing it's a variable. Try backgroundColor (note the casing) instead of background. On 8/11/05, Jim Campbell <[EMAIL PROTECTED]> wrote: > Does it matter if you put the element ID in quotes? > > getElementById("CurrentHighlightedCell")... > > - Jim > > Jeff W wrote: > > >Can anyone tell me WHY this won't work in NS6.1 but work fine in ie5-6, > >firefox and NS8?? > > > >document.getElementById(CurrentHighlightedCell).style.background='#006600'; > > > >CurrentHighlightedCell is a variable that contains the current id of the > > background color I am changing. > > > >Thanks.. > >Jeff > > > > > > > > ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:214586 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: OT: Javascript browser compatibility question.
NS6 was a bastard that didn't work. Did you try backgroundColor? cheers, barneyb On 8/11/05, Jeff W <[EMAIL PROTECTED]> wrote: > Can anyone tell me WHY this won't work in NS6.1 but work fine in ie5-6, > firefox and NS8?? > > document.getElementById(CurrentHighlightedCell).style.background='#006600'; > > CurrentHighlightedCell is a variable that contains the current id of the > background color I am changing. > > Thanks.. > Jeff > -- Barney Boisvert [EMAIL PROTECTED] 360.319.6145 http://www.barneyb.com/ Got Gmail? I have 50 invites. ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:214585 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
Re: OT: Javascript browser compatibility question.
Does it matter if you put the element ID in quotes? getElementById("CurrentHighlightedCell")... - Jim Jeff W wrote: >Can anyone tell me WHY this won't work in NS6.1 but work fine in ie5-6, >firefox and NS8?? > >document.getElementById(CurrentHighlightedCell).style.background='#006600'; > >CurrentHighlightedCell is a variable that contains the current id of the > background color I am changing. > >Thanks.. >Jeff > > > ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:214584 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54