473,406 Members | 2,549 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.

It works but get an "invalid argument" error

The code below works fine in IE7 and Firefox2 but gets an "Invalid Argument"
error in IE7. I've tried quotes around "ShowContent" ( I've used double "
and single ' ) but it doesn't work at all with quotes. Anyone know what's
happening. Thanks.

<body onload="javascript:setTimeout(ShowContent('success '),1000)">

function ShowContent(d) {
document.getElementById(d).style.display = "block";
}
May 27 '07 #1
3 6170
VK
On May 27, 6:22 pm, "Don M" <d...@home.comwrote:
<body onload="javascript:setTimeout(ShowContent('success '),1000)">
About the parasite javascript: "prefix" in intrinsic event handlers
see
http://groups.google.com/group/comp....bd93952cd82670

About the problem itself:
setTimeout(ShowContent('success'),1000)
means:
"execute ShowContent right now and call its return value (so
presumably a function reference) in 1sec after pafe load".

It is nothing of what you really want to do. You want
"execute ShowContent is 1sec after page load"
so let's do it:

<body onload="setTimeout('ShowContent(\'success\')', 1000)">
May 27 '07 #2
Don M wrote:
The code below works fine in IE7 and Firefox2 but gets an "Invalid
Argument" error in IE7. I've tried quotes around "ShowContent" ( I've
used double " and single ' ) but it doesn't work at all with quotes.
Anyone know what's happening. Thanks.

<body onload="javascript:setTimeout(ShowContent('success '),1000)">

function ShowContent(d) {
document.getElementById(d).style.display = "block";
}
<body onload="setTimeout(function() { ShowContent('success'); }, 1000);">

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
May 27 '07 #3
VK & -Lost , works great without an error. Thanks a lot.

"VK" <sc**********@yahoo.comwrote in message
news:11**********************@q69g2000hsb.googlegr oups.com...
On May 27, 6:22 pm, "Don M" <d...@home.comwrote:
><body onload="javascript:setTimeout(ShowContent('success '),1000)">

About the parasite javascript: "prefix" in intrinsic event handlers
see
http://groups.google.com/group/comp....bd93952cd82670

About the problem itself:
setTimeout(ShowContent('success'),1000)
means:
"execute ShowContent right now and call its return value (so
presumably a function reference) in 1sec after pafe load".

It is nothing of what you really want to do. You want
"execute ShowContent is 1sec after page load"
so let's do it:

<body onload="setTimeout('ShowContent(\'success\')', 1000)">

May 27 '07 #4

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

Similar topics

3
by: Stephen Poley | last post by:
Could some kind soul explain the errors and warnings that the W3C CSS validator generates for page: http://www.atlis.nl/testsite/nl/ Results at: http://tinyurl.com/5pxqx The error "Invalid...
12
by: Yarco | last post by:
when doing fork in a loop: while(1) { tmp_sd = accept(sd, (struct sockaddr*)&tmp_sin, &len); if (tmp_sd == -1) { perror("accept"); exit(0); } //check client ip
0
by: Winterminute | last post by:
I am trying to read a list of install programs using WMI with ASP.NET/C#. However, it fails with "Invalid Class". I have confirmed that if I query LOCALHOST then it works fine, but if I query a...
5
by: jdircksen | last post by:
I have a table that keeps crashing. The only error message I get is "Invalid Argument". Each time, a single record will turn into "#Error". Each field says this in the row. When this happens, Access...
1
by: Java Guy | last post by:
I'm trying to view a web page. IE tells me there are (Java?) errors on the page. Here they are: Line: 15 Char: 7 Error: Wrong number of arguments or invalid propert assignment Code: 0 URL:...
1
by: jjelswick | last post by:
my daughter was sending pics of my grandaughters, i right clicked on them and saved them as a screensaver to look at daily(1st twin grandchildren) now i keep getting invalid argument error and...
3
by: Robert Wakefield | last post by:
Hey, all. I'm charged with the creation of visual product recognition software. I chose Access, because it's available. I'm importing graphics into a form, and it's been working, but the 2gig...
4
by: robert | last post by:
On a server the binary (red hat) installed python2.4 and also a fresh compiled python2.5 spits "sem_post: Invalid argument". What is this and how can this solved? Robert ============== ...
1
by: eBob.com | last post by:
I have some code which is trying to determine where text will wrap in a custom text box (which Inherits from Control). It determines the number of characters which will fit in the first line, but...
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...
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
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
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
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,...

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.