473,503 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how do i access background-image?

I tried obj.style.background-image, and got the error "'image' is
undefined".

Thanks
Martin

Jul 23 '05 #1
4 5279
mp****@qualtech-int.com.au wrote:
I tried obj.style.background-image, and got the error "'image' is
undefined".


..backgroundImage

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #2
mpa...@qualtech-int.com.au wrote:
I tried obj.style.background-image, and got the error "'image' is
undefined".


Try:

obj.style.backgroundImage
hyphens are not allowed in JavaScript identifiers. As a general rule
when dealing with style attributes, drop the hyphen and capitalise the
first character of the next word.

--
Rob

Jul 23 '05 #3
Syntax is: obj.style.backgroundImage
No dash -- uppercase I.
The dash was interpretted as a minus sign -- Subtract the variable
"image" -- and you get "image" is undefined.
....Jim Lee, Dallas, TX...

<mp****@qualtech-int.com.au> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
I tried obj.style.background-image, and got the error "'image' is
undefined".

Thanks
Martin

Jul 23 '05 #4
RobG wrote:
Try:

obj.style.backgroundImage
hyphens are not allowed in JavaScript identifiers. [...]


That is not entirely true. The hyphen is in fact a minus which acts as
an operator in JS, and operator whitespace is optional. That is why it
cannot be part of an identifier.
PointedEars
--
************************************************** **********
* NEW: psf suited for <http://tagzilla.mozdev.org/>! *
* <http://pointedears.de/psf/> *
************************************************** **********
Jul 23 '05 #5

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

Similar topics

3
2825
by: niv | last post by:
i have a database, one of the fields is a hyperlink to a htm file. i want to activate it automaticly as the asp file is loaded no click is needed.so that the background of the BODY part will...
11
15722
by: George Hester | last post by:
I have a css file this is a portion of it: /* trackaccept.css */ div.track { width:400px; height: 100px; } I have this in my ASP page:
4
2317
by: coolsti | last post by:
I have been playing around with this task for some hours now, and can't seem to find a way. I have an assortment of buttons on a web page, which have their background colors defined via style...
3
5918
by: Jouke Langhout | last post by:
Hello all! For quite some time now, I've got the following problem: Access won't close properly when a user closes the application. An ACCESS process stays active and that process can only be...
1
1404
by: Christopher | last post by:
In one of our ASP.NET Pages, we are starting a new background thread that we do not need to go and get any status on or use after the page finishes. The thread merely does some background stuff on...
52
9914
by: Neil | last post by:
We are running an Access 2000 MDB with a SQL 7 back end. Our network guy is upgrading to Windows Server 2003 and wants to upgrade Office and SQL Server at the same time. We're moving to SQL Server...
3
4224
by: Yashesh Bhatia | last post by:
Hi Sorry if it's a trivial question. I'm a newbie to js and did some reading since the last 3-4 hrs but have not been able to get the answers, hence this post. essentially i'm trying to...
5
3191
by: BA | last post by:
Hi there I am trying to write an "application" in Access 2000, that displays a front end and allows the user to interact with the database without seeing Access loaded, in the background, nor on...
5
3265
by: sierra7 | last post by:
Hi I have been writing Access applications for some years now and have moved away from from the 'Switchboard' type of opening form to using a menubar accross the top of the screen and borderless...
3
2577
by: bettyboo | last post by:
Hi I'm new to the forum and also a VERY new user of Access to develop databases. I'm building a DB for a driving instructor acquaintance, and he wants a button on the pupil data entry form which...
0
7076
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
7323
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
7453
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
5576
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,...
1
5005
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...
0
3151
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1507
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 ...
1
732
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
377
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.