473,378 Members | 1,475 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,378 software developers and data experts.

object not found onload

The onload event appears to be firing before all the content of my
window loads or something. In the stripped down example below, my
browser tells me that it cannot find the object "thisThing." What
gives?
<html>
<head>

<script type="text/javascript">
window.onload = document.getElementById("thisThing").style.backgro und =
"red";
</script>

</head>
<body>
<div id="thisThing" style="height:40px; width:50px;
background:blue">
</div>

</body>
</html>

Jul 23 '05 #1
3 3385
va********@hotmail.com wrote:
The onload event appears to be firing before all the content of my
window loads or something. In the stripped down example below, my
browser tells me that it cannot find the object "thisThing."


You've already got answers to that question last time you asked, e.g.
http://groups.google.de/groups?ie=UT...13kvk@atlantis

ciao, dhgm
Jul 23 '05 #2
Lee
va********@hotmail.com said:

The onload event appears to be firing before all the content of my
window loads or something. In the stripped down example below, my
browser tells me that it cannot find the object "thisThing." What
gives?
<html>
<head>

<script type="text/javascript">
window.onload = document.getElementById("thisThing").style.backgro und =
"red";
</script>

The onload event has nothing to do with your error.
The error is that you're invoking document.getElementById("thisThing")
in the <head> section, before the page loads.

Jul 23 '05 #3
yeh...My bad, Dietmar.

I post on Google. Up until its fairly recent changes, a search on my
nickname ("2obvious") would skip me right to my latest post. Now,
apparently, the nickname can be toggled. When I didn't see my latest
post in a search, I assumed there was glitch and that I hadn't posted.
Bad form on my part.

Thanks for the link. Saves me the trouble of redirecting this post to
a correct answer myself.

--E.

Jul 23 '05 #4

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

Similar topics

4
by: KathyB | last post by:
I have the following script in an html page: function goToPosition() { varGoTo = document.write(document.cookie("Position")); document.scrollTo(0, varGoTo); } </head> <body...
3
by: JayBrahms | last post by:
Hi there. OK, this is a little bit complicated. I would live to find a different way to do this, but evidentially I am not able to open a Text-File in JAVASCRIPT and fill an Array with the...
2
by: Boban Dragojlovic | last post by:
I'm building a complex web-based reservations system. Gathering the user's data requires between 8 and 15 pages (depending on which options they are interested in). I use the "Session" object to...
3
by: Frank Esser | last post by:
Hi, I created a base class for my project from that all other pages inherit. Within this page in the OnLoad event I set some session object variables. My intention is that first of all the...
2
by: Martin Honnen | last post by:
I was playing around with canvas support in recent Safari, Mozilla and Opera (only version 9 preview) but run into issues with Safari related to the very old DOM Level 0 Image object for preloading...
26
by: yb | last post by:
Hi, Is there a standard for the global 'window' object in browsers? For example, it supports methods such as setInterval and clearInterval, and several others. I know that w3c standardized...
7
by: multicherry | last post by:
Hi, Having searched for a way to fetch a window object by name, all I came across were answers along the line of... "All you have to do is say windowObj = window.open("blah", "name");" which...
8
by: psema4 | last post by:
Hi all, I've spent several days trying to work this out. Maybe I'm just searching for the wrong keywords/phrases. I have some code that looks like: Console = new Object(); Console.init...
2
by: Calm_Pear | last post by:
Hi all, I have created an object with a default function; the default function exposes a public function as well. myobject = function(){
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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...

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.