473,326 Members | 2,813 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,326 software developers and data experts.

Another Error Object Expected ?

Hello all, I am new here and hope some kind, smarter than me person can help.
I am getting the error object expected with the following code:

Expand|Select|Wrap|Line Numbers
  1. function click(e); 
here the error says it expected '{' at Char:18

External js code for this is here:

Expand|Select|Wrap|Line Numbers
  1. function click(e) {
  2.     if (document.all) {
  3.         if (event.button == 2) {
  4.             alert(message);
  5.             return false;
  6.         }
  7.     }
  8.     if (document.layers) {
  9.         if (e.which == 3) {
  10.             alert(message);
  11.             return false;
  12.         }
  13.     }
  14. }
  15. if (document.layers) {
  16.     document.captureEvents(Event.MOUSEDOWN);
  17. }
  18. document.onmousedown=click;
Thank you for your help.
Julie
Oct 19 '07 #1
7 2280
gits
5,390 Expert Mod 4TB
hi ...

welcome to TSDN ...

i assume its the problem with your homepage? you mustn't write the following code, as you can see this is syntactically wrong:

[HTML]<script language="JavaScript" type="text/javascript">
<!--
function click(e);
-->
</script>[/HTML]
since:

Expand|Select|Wrap|Line Numbers
  1. document.onmousedown = click
already assigns the eventhandling during the external js includes parsing ... simply remove the useless statements

kind regards
Oct 19 '07 #2
thanks much for the fast reply.
I did what you said and that cleared up the one error, but I am still missing something.

I still get the object required error for line 43 which is blank so I would think that I still need something after

function click(e); (this is line 42)


I am very new to javascript.
Thanks
Julie
Oct 19 '07 #3
gits
5,390 Expert Mod 4TB
so i assume you have removed the following lines?

[HTML]<script language="JavaScript" type="text/javascript">
<!--
function click(e);
-->
</script>[/HTML]
kind regards
Oct 19 '07 #4
Yes, thanks to your wonderful help, I removed that and it still works fine without an error.

The very weird thing is I still get one error on line 43 which is blank. No code on it but IE7 still shows an error.
very strange.
thanks,
Julie
Oct 21 '07 #5
gits
5,390 Expert Mod 4TB
could you post the script that throws the error? because you have removed the lines ... so what is before and behind it?

kind regards
Oct 21 '07 #6
Hello,

I get this error on every page on my site. It is the only error.

Line: 43
Char: 11
Error: Object Expected
Code: )
URL: http://www.better-skin-care.com

Below is my code in Dreamweaver 8.


<body> is on line 40




<div id="header"> is on line 45
<!--======================== BEGIN COPYING THE HTML HERE ==========================-->
<img src="images/header22.png" alt="" name="header22" width="960" height="85" border="0" id="header22" />
<!--========================= STOP COPYING THE HTML HERE =========================-->
</div>

The line the error refers to is blank.
So I just don't know how to fix a blank line.

thanks again,
Julie
Oct 22 '07 #7
Try running it through another validator like the w3c.org site and see where they report your error. this might suggest a line that contains code.

--hm
Oct 22 '07 #8

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

Similar topics

6
by: lawrence | last post by:
Is this a valid class definition? class McBase { // 06-14-04 - I may or may not later add something here. This will // be the top of the PDS content management system hierarchy. I'm //...
9
by: Thomas Christensen | last post by:
If anyone can provide an explanation and/or workaround for this bug in IE I would be really grateful. Is this a known bug?: ******CODE******* <html> <script type="text/javascript"> function...
1
by: Franko | last post by:
I get the following error. Please help c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx(6,38): error CS1001: Identifier expected c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx(6,52): error...
1
by: Franko | last post by:
I get the following error. Please help c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx(6,38): error CS1001: Identifier expected c:\inetpub\wwwroot\WebApplication1\WebForm2.aspx(6,52): error...
5
by: mackenzie | last post by:
Hello, I am looking for a little bit of help. I am trying to create a dynamically allocated object which contains one or more objects of type boost::pool<>. I get a compiler error when an object...
1
by: JOJO123 | last post by:
I got here in search of an answer to this Javascrpt question. I upgraded jave on XP Ie 7, acrobat 5.1 and suddenly can't open any pdf files on web sites using IE. I see u guys all say, this is a...
6
by: Lawrence Spector | last post by:
I ran into a problem using g++. Visual Studio 2005 never complained about this, but with g++ I ran into this error. I can't figure out if I've done something wrong or if this is a compiler bug. ...
1
by: BSand0764 | last post by:
I'm getting an error that I can't seem to resolve. When I compile the Functor related logic in a test program, the files compile and execute properly (see Listing #1). However, when I...
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...
0
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: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.