Javascript "Error: Object required"

With IE7 if you go here
then enter for example the values 11, 11 and 11 as "dimensioni"
this Javasscript error appears:
Line: 15
Char: 3
Error: Object required
Code: 0

If I open the source of the page I don't see anything that matters in line 15.

How can I know what file and line it's referring to?  what debugging tool should I use?

Note: in Firefox with Firebug I don't see any Javascript error.   I see it only in IE7
Who is Participating?
I found that your error comes from line 14 of ZeroClipboard.js

     if (!thingy.addClass) {

This error is raised because thingy is null, so you cannot check whether thingy.addClass exists. When using firebug, I found that you call that function with 'd_clip_button' as thingy.

Solution: check thingy's existence first

if (!!thingy && !thingy.addClass) {
Chances are the error is on line 14 or sixteen - the notifier is notoriously errant ;-)
lucavillaAuthor Commented:
here are the lines from 8 to 17:

<style type="text/css">
body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;

Still convinced that the Javascript error can be from line 14 to line 16?    :)

I suspect that the error is in some third file (...js) called by this page but how can I find what is it?
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Badotz is right in that you should ignore the Line/char, esp. if you have external javascripts, nobody knows how to go from those data to the real position. However, running your page through Visual Studio gives that:

  • on line 814 of script-get.js, the function OnResize is called (don't know why) with the method clip.reposition("d_clip_button")
  • then, on line 172 of ZeroClipboard.js there's a function "reposition" which calls ZeroClpboard.$(elem), with the value "d_clip_button" (still).
  • then, on line 14 (yes, that's quite close to the said line 15) inside the function $, the method thingy.addClass is called, but thingy is null (on the line before that, getElementById(thingy) did not succeed, because the element "d_clip_button" apparently does not exist.
That's what I got. What it does, I don't know, but that's the source of your error.

-- Abel --



on its own line in the .JS file and step through your code.
Or look in each external .JS file for lines 14-16 and see if you can figure it out from there, smarty=pants ;-)
> Or look in each external .JS file for lines 14-16

check above: it si in the script-get.js, line 15, trying to do a getElementById with a non-existing element id and then referencing that element ;-)
@bui_trung_hieu, no offense meant, but 4 comments ago, I said exactly that: #24181052  :)
@abel : sorry, I didn't see your answer when posting mine.
np, I see now that the time wasn't that far apart and I have it all the time myself as well ;)
lucavillaAuthor Commented:
thanks abel
and thanks bui_trung_hieu for the fast "solution", that worked :-D
> thanks abel and thanks bui_trung_hieu for the fast "solution", that worked :-D

glad we could be of some help :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.