Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script Error: Object Required

Status
Not open for further replies.

mguwc

Technical User
Mar 16, 2004
74
US
Hi All - the error I get is this:

Line: 47
Char: 2
Error: Object Required
Code: 0
URL: of Form.aspx

When I look at that in the html source there is nothing in Line 47 Char 2.

Another scripting error I get is

Line: 119
Char: 2
Error: "Trigger" is null or not an object
Code: 0
URL: of Form.aspx

What puzzles me the most is that the form html source only goes to line 82. There the 2nd especially makes no sense to me.

These errors cause a dhtml menu to not build completely, thus not allowing a couple of linked pages to work. When I then go to another page, the links are then established.

Can anyone help?

- Maria
 
Can you post yor code, or a URL to it?

At a guess, check that the path and filename of the script includes are correct, and are the same case as the actual script filename.

Hope this helps,
Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
mguwc, if you are using any server side includes that code is counted in the line numbers for the error but of course do not show up in your HTML. Also, if any of your code is dynamically generated that can affect the reported line number compared to your actual HTML page.

Your best bet when trying to debug is to do a View Source from the browser to check the referenced line number. Just remember if you decide to make a change while looking at the code that you need to switch back to your original and not make the changes in the one you are viewing from the browser. :)

Most likely the line 47 error is an HTML line that calls your function and the error really means the function is expecting something it did not get and refers back to the line that called it even if that line is not the source of the problem.
Most likely your function is trying to use a value that has not been defined or is trying to look up a value from the form but cannot identify the form field specified.
Your next error for line 119 is telling you that it got a null value for Trigger or that the object you are trying to read to get the value does not actually exist. In fact Trigger might exist but you have not addressed it correctly so the function could not retrieve the object.

Without seeing code all we can do is guess.


Stamp out, eliminate and abolish redundancy!
 
Hello -
Okay...I downloaded the javascript debugger and found where the trigger issue lies. I am very new at javascript so I don't really know what I am looking for or how to resolve the issue.

Menu_com.js has
var Trigger=NavYes&&!Opr?Par:Bod;
this is producing the null variable.

This is the HV menu that I downloaded from dynamic drive.
- Maria
 
Hello - I found this online and tried it and it seemed to work. I don't know, however, what Exp6Plus refers to...but it works for me too.



Hi all,

I get an error after hitting the login button (using MSIE 6.0.2600.0000):
"Runtime error, line 46, object expected". The welcome page is displayed,
but with no horizontal menu (only the buttons on the left).

The error is in menu_lib.js, the line that reads:
"if(Trigger.onload)Dummy=Trigger.onload;"

The error occurs because "Trigger" is null. Line 40 sets "Trigger": "var
Trigger=NavYes&&!Opr?Par:Bod;" Trigger is not set because "Bod" is null;
Par is not null.

Line 39 sets "Bod": "var Bod = Doc.body;" Doc.body is null.

I don't fully understand all the intricacies of the script so I hacked a
solution. I altered line 40 to "var
Trigger=(NavYes&&!Opr)||Exp6Plus?Par:Bod;" and the error goes away, and the
horizontal menu items appear, although some of the text on the menu items is
not visible. The menu items do work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top