473,406 Members | 2,867 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,406 software developers and data experts.

Background Color


Hi,

I have the following javascript that should change the background color of
an element in a table:

script.Append("document.getElementById(selectedDat eId).style.backgroundColor
= \"#00008b\"; \n");
script.Append("document.getElementById(selectedDat eId).className =
\"AIMSSelectedDay\"; \n");

However, the color is never changed. I tried to put some "alert" statement
to see whether the function is accessed, and it is. Am I doing something
wrong?

Thanks.
Mike
Nov 18 '05 #1
3 1025
Is there a javascript error? (use fireforx and type javascript: to see
errors).

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Mike" <Mi**@discussions.microsoft.com> wrote in message
news:38**********************************@microsof t.com...

Hi,

I have the following javascript that should change the background color of
an element in a table:

script.Append("document.getElementById(selectedDat eId).style.backgroundColor = \"#00008b\"; \n");
script.Append("document.getElementById(selectedDat eId).className =
\"AIMSSelectedDay\"; \n");

However, the color is never changed. I tried to put some "alert" statement
to see whether the function is accessed, and it is. Am I doing something
wrong?

Thanks.
Mike

Nov 18 '05 #2

No javascript error.

"Karl Seguin" wrote:
Is there a javascript error? (use fireforx and type javascript: to see
errors).

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Mike" <Mi**@discussions.microsoft.com> wrote in message
news:38**********************************@microsof t.com...

Hi,

I have the following javascript that should change the background color of
an element in a table:

script.Append("document.getElementById(selectedDat eId).style.backgroundColor
= \"#00008b\"; \n");
script.Append("document.getElementById(selectedDat eId).className =
\"AIMSSelectedDay\"; \n");

However, the color is never changed. I tried to put some "alert" statement
to see whether the function is accessed, and it is. Am I doing something
wrong?

Thanks.
Mike


Nov 18 '05 #3
I ask because the javascript looks fine, all I can think of is that
selectedDateId isn't a valid identifier..:

I imagine you are actually doing something like:
getElementById(\"" + selectedData.UniqueId + "\")...

OR

selectedDataId is an actual JS variable which you hopefully properly assign
before this code executes..

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Mike" <Mi**@discussions.microsoft.com> wrote in message
news:12**********************************@microsof t.com...

No javascript error.

"Karl Seguin" wrote:
Is there a javascript error? (use fireforx and type javascript: to see
errors).

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Mike" <Mi**@discussions.microsoft.com> wrote in message
news:38**********************************@microsof t.com...

Hi,

I have the following javascript that should change the background color of an element in a table:

script.Append("document.getElementById(selectedDat eId).style.backgroundColor
= \"#00008b\"; \n");
script.Append("document.getElementById(selectedDat eId).className =
\"AIMSSelectedDay\"; \n");

However, the color is never changed. I tried to put some "alert" statement to see whether the function is accessed, and it is. Am I doing something wrong?

Thanks.
Mike


Nov 18 '05 #4

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

Similar topics

4
by: erik | last post by:
Is it posssible to inherit the previous pages (parent pages) background image? Is there a script out there I could look at? Thanks
12
by: Stanimir Stamenkov | last post by:
Here are two cases regarding inline-level elements' line-height, padding and background, which I doesn't understand: <div style="background: black; color: white; line-height: 1.5">...
27
by: Kevin Yu | last post by:
When I declare on HTML page <LINK href="mycss.css" type="text/css" rel=stylesheet /> .... <BODY class=myclass> in mycss.css BODY { FONT-WEIGHT: bold; FONT-SIZE: 12px; FONT-FAMILY:...
3
by: MediaDesign | last post by:
so there's the problem: my text links have background images and when I put links around images on my page, they too get the background image treatment which I do not...I have tried several...
11
by: Konrad Den Ende | last post by:
I have a function returning a string but the problem is that the color of it is blue which suits me well for some pages but not for others. Is it possible to "feel" what the color of the background...
5
by: proximus | last post by:
Hi, I am trying to change the background of table TD's. The problem is that I have no access to the HTML code. SO I am trying to alter this using Javascript/DOM in an external .js file. I...
16
by: stevedude | last post by:
CSS newbie again. I have a problem trying to get coffee mug images within anchor tags to center with my link text for a vertical list menu. If I use the horizontal/vertical properties of...
19
by: david.karr | last post by:
If in my CSS I set the "background-color" property on the "body" element, it only covers the background of the elements defined in the body, up to the current width and height of the page. However,...
10
by: VividWeb | last post by:
Hi. I am relatively new to CSS and HTML but have a basic understanding of most things. One of my backgrounds is not positioning correctly in IE 7 or AOL. The background behind the content...
2
by: thephatp | last post by:
I'm having a problem with IE rendering correctly. I'm experimenting with using all div's in my pages now, and I'm not very familiar with the quirks of IE. I have created a sample page, and I'm...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.