473,554 Members | 2,152 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

bgColor error. What am I doing wrong?


I set up a table...

<table
bgcolor=#FF9966
name=msSel
onmouseover="ms Sel.bgColor='#F FCC66'"
onmouseout="dif ferentFunction ();"
<tr><td>stuff </tr></td>
>
mouseout is eventully supposed to do several things,
only one of which is to reset the single cell table
color. A shortened function would be

function differentFuncti on (){

msSel.bgColor=" #FF9966" ;
// other stuff here
} ;

on mouseout, a msSEL not found error is returned from
inside differentFuncti on.

substituting "this.bgCol or" neither returns an error
nor changes the color. There are other reasons later
for not using "this" instead of specific names.

Why the error?
What is the correction or workaround?


--
Many thanks,

Don Lancaster voice phone: (928)428-4073
Synergetics 3860 West First Street Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml email: do*@tinaja.com

Please visit my GURU's LAIR web site at http://www.tinaja.com
Apr 24 '07 #1
4 1661
Don Lancaster said the following on 4/24/2007 11:58 AM:
>
I set up a table...

<table
bgcolor=#FF9966
name=msSel
onmouseover="ms Sel.bgColor='#F FCC66'"
onmouseout="dif ferentFunction ();"
<tr><td>stuff </tr></td>
>

mouseout is eventully supposed to do several things,
only one of which is to reset the single cell table
color. A shortened function would be

function differentFuncti on (){

msSel.bgColor=" #FF9966" ;
// other stuff here
} ;

on mouseout, a msSEL not found error is returned from
inside differentFuncti on.
<URL: http://jibbering.com/faq/index.html#FAQ4 _41>

onmouseout="dif ferentFunction( this)"

function differentFuncti on(elem){
elem.bgColor="# FF9966"
}

But, why do you quote in your function (which you should) but not in
your HTML (which you should) while using deprecated HTML3.2 bgcolor
(which you shouldn't). CSS is your friend.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Apr 24 '07 #2
On Apr 24, 11:58 am, Don Lancaster <d...@tinaja.co mwrote:
function differentFuncti on (){
msSel.bgColor=" #FF9966" ;
this.style.back groundColor = "#FF9966";

Kev

Apr 25 '07 #3
Kevin Darling said the following on 4/25/2007 6:36 PM:
On Apr 24, 11:58 am, Don Lancaster <d...@tinaja.co mwrote:
> function differentFuncti on (){
msSel.bgColor=" #FF9966" ;

this.style.back groundColor = "#FF9966";
In that scenario? "this" doesn't refer to what you think it does. Test it :)

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Apr 25 '07 #4
On Apr 25, 6:41 pm, Randy Webb <HikksNotAtH... @aol.comwrote:
Kevin Darling said the following on 4/25/2007 6:36 PM:
On Apr 24, 11:58 am, Don Lancaster <d...@tinaja.co mwrote:
function differentFuncti on (){
msSel.bgColor=" #FF9966" ;
this.style.back groundColor = "#FF9966";

In that scenario? "this" doesn't refer to what you think it does. Test it :)
D'oh !! Yes, I know that. I posted very quickly before dinner and
mixed up editing two different answers. Shame on me!

Thanks for pointing it out :-)

Kev

Apr 26 '07 #5

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

Similar topics

1
5036
by: Nat | last post by:
Hi I have following code: ----------------- protected override void Render(HtmlTextWriter w) { if (helpString!=null) { w.Write("<span class='tooltipiconouter'><img title = '"+this.helpString+"' class='tooltipIconInner' align='center' src = '../Lib/images/questionmark.gif' a href='#' onclick = 'myWin = window.open(\"\", \"\", \"width=300,...
15
2439
by: @sh | last post by:
Trying to do this, but its not working...?! My aim being to change the bgcolor of the cell upon which the user has rolled over, I'll then replicate this as an OnMouseOut to change it back. ----------------------------- <script language="JavaScript"> <!-- function Ash_TopNavRollovers(TheObject); { TheObject.bgcolor="#000099;"; }
16
7202
by: TD | last post by:
This is the code under a command button - Dim ctl As Control For Each ctl In Me.Controls If ctl.BackColor <> RGB(255, 255, 255) Then ctl.BackColor = RGB(255, 255, 255) End If Next ctl
7
1562
by: Brett | last post by:
I'm not sure why I keep getting this error, "Object reference not set to an instance of an object". Private Function somefunction() as string Dim MyCurrentClass As New Class1 Try For i As Integer = 0 To LinkResults.Length - 1 With MyCurrentClass.SqlCmd_Insert_LinkVB .CommandType = System.Data.CommandType.StoredProcedure
6
3720
by: acord | last post by:
Hi, I want to change the background color of a ul/li row, but the following code is not working as I expected. It works in <table><tr>... <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
1461
by: GaryDean | last post by:
I need to be able to change the background color of a page from code. I found an answer to this question in another forum from Peter Huang that said that an id="bg" as follows... <body MS_POSITIONING="GridLayout" runat="server" id="bg"> then we could do the following in our codebehind file.... Private Sub Page_Load(sender As Object, e...
12
4513
by: GaryDean | last post by:
In the original post I failed so indicate that I am using framework 1.1....... I need to be able to change the background color of a page from code. I found an answer to this question in another forum from Peter Huang that said that an id="bg" as follows... <body MS_POSITIONING="GridLayout" runat="server" id="bg"> then we could do...
5
1831
by: Don Lancaster | last post by:
I am trying to change a group of background colors by calculating their names in a loop . Names are cfh13, cfh15, cfh17, etc... Unlooped code like cfh17.bgColor="#CCFFFF" ; works just fine. Code that does NOT involve a background color change but is calculated
0
7808
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8047
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7570
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6156
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5441
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5162
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3570
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3556
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2022
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.