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

Problem with body onLoad

219 100+
I'm trying to have a function called when the page loads. I have this in my code

Expand|Select|Wrap|Line Numbers
  1. <body onLoad="load()">
  2.  
then my javascript:
I commented out all my lines and am using only an alert to make sure it's working, but I'm seeing an error displaying "Object Expected". My function isn't expecting an object, what gives?

Expand|Select|Wrap|Line Numbers
  1. function load(){
  2.     alert("hi");
  3. //    var el = document.getElementByTagName("input");
  4. //    for(i=0;i<el.length;i++){
  5. //        alert(el[i]);
  6.         //el[i].addEventListener("click", clearField,false);
  7.     }
  8.  
Oct 17 '07 #1
2 1106
mrhoo
428 256MB
you didn't comment the function brackets correctly, so it was never defined.
don't call a function 'load'- several browsers define a global window.load method
Oct 17 '07 #2
dmorand
219 100+
you didn't comment the function brackets correctly, so it was never defined.
don't call a function 'load'- several browsers define a global window.load method
Ok cool thanks. I'll do that now.
Oct 17 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: JesusFreak | last post by:
From: us_traveller@yahoo.com (JesusFreak) Newsgroups: microsoft.public.scripting.jscript Subject: toolbar script problem NNTP-Posting-Host: 192.92.126.136 Recently, I downloaded the following...
4
by: VR | last post by:
First, greetings to everyone :) I'm doing a university seminar & I've encountered a problem. I have a gallery with thumbnails linked on pictures. What I want is popup to be opened with...
5
by: Patient Guy | last post by:
I have this in a document: <body onload="a_function(this);"> In an (external) script file, I define a_function() as follows: function a_function(obj) { // surprise errant coding here
3
by: nisiwi | last post by:
hello, first time here and for posting i was researching some problems I was having with a resizer javascript it uses window.onload which causes problems with some other flash and js on the page...
2
by: swethak | last post by:
Hi, I am getting the problem the problem with google map in Internet Explorer. This map worked fine in mozilla . When i opened the same map in Internet Explorer i am getting the error...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.