473,395 Members | 1,497 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

DOM Changes Won't Display

I have a table in IE 6.0 listing several items where clicking on a row will
bring up another window showing details for that item. Clicking a
particular button on the detail window will change how that item appears on
the initial list screen by altering it's background color, class name, and
default cursor.

The problem I'm having is this -- sometimes it works and sometimes it
doesn't.

There doesn't appear to be any rhyme or reason as to when it works and when
it doesn't. Below is a code snippet showing how I'm going about making
these changes. Any input would be appreciated.

trNode.className = "approved";
trNode.style.backgroundColor = approvedColor;
trNode.style.cursor = "default";
Jul 23 '05 #1
2 1082
Tom Frantz wrote:
I have a table in IE 6.0 listing several items where clicking on a row will
bring up another window showing details for that item. Clicking a
particular button on the detail window will change how that item appears on
the initial list screen by altering it's background color, class name, and
default cursor.

The problem I'm having is this -- sometimes it works and sometimes it
doesn't.

There doesn't appear to be any rhyme or reason as to when it works and when
it doesn't. Below is a code snippet showing how I'm going about making
these changes. Any input would be appreciated.

trNode.className = "approved";
trNode.style.backgroundColor = approvedColor;
trNode.style.cursor = "default";


Your code as posted is OK, below is a small bit of play code to test
it. It's reliable in IE as far as I can tell.

You may need to post a bit more of your code - usually a minimal
implementation that still shows the error (which may lead you to fixing
it...)

Rob.
<html><head>
<title>test code</title>
<script type="text/javascript">
function doChange(trNode) {
var approvedColor = 'blue';
trNode.className = "approved";
trNode.style.backgroundColor = approvedColor;
trNode.style.cursor = "default";
}
</script>
<style type="text/css">
..approved
{font-family: sans-serif; font-size: 2em;}
..notapproved
{font-family: courier; font-size: 1em;
background-color: pink; cursor: pointer;}
td
{border: thin solid red;}
</style>
</head>
<body>

<table>
<tr>
<td onclick="doChange(this);"
class="notapproved">this is the td</td>
</tr>
</table>
</body></html>
Jul 23 '05 #2
On Mon, 22 Nov 2004 21:36:58 -0500, Tom Frantz <to*******@comcast.net>
wrote:

[snip]
trNode.className = "approved";
trNode.style.backgroundColor = approvedColor;
trNode.style.cursor = "default";


There's nothing I can suggest code-wise without at least an example
showing the problem (which you seem to be unable to supply). However,
might I ask why the background colour and cursor styles aren't set as part
of the CSS class? Can the "approved color" change according to some
condition so a fixed value in the style sheet is inappropriate?

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: MacDermott | last post by:
For a client who wants answers, but doesn't want to bother to learn Access, I've built a cut-down query generator, where they can select fields and criteria. I then compose the appropriate SQL...
6
by: Ian Boyd | last post by:
Every time during development we had to make table changes, we use Control Center. Most of the time, Control Center fails. If you try to "undo all", it doesn't, and you end up losing your identity...
1
by: Jeff | last post by:
Hi all, I'd like to be able to detect when page content is dynamically changed by Javascript. I'd like to detect any changes to the content, such as the addition of new DOM elements and when...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.