When I write Javascript, I use window.alert () for debugging. Usually I pass in variables for warning, and a pop-up line appears containing this value of the variables. However, if I pass a warning about an object, it tells me the type of object. For instance:
var form = document.getElementById("my_form");
alert(form);
This bit, the part that says [blah blah object]. What is this property? I recently started creating my own objects to encapsulate the useful parts of the site I'm working on ... but when I pass my own objects for warning, it gives me a general message [object Object], which is not very useful if I have done a bunch of different types of objects. I would prefer, for example, my object to return to me something more along the lines of [object My_Object].
Is there a property that I can set in the My_Object () function that will tell me what I want to tell me?
Thank!
g.
Ziggy source
share