简体   繁体   中英

What could be causing this [object HTMLTableCellElement] tooltip on Firefox?

On Firefox, when hovering the mouse over a certain table in my webpage a strange [object HTMLTableCellElement] tooltip appears:

奇怪的工具提示

What needs to happen for this to occur? I am having a hard time narrowing what part of my code is the culprit because I don't even know what to look for.


Edit, solved the problem:

This table belongs to a Dojo Dijit template . I accidentaly gave one of the template's nodes the dojo-attach-point "title", causing Dojo to, during the rendering of the Widget, do a

this.title = the_node_with_the_bad_attach_point

The node is then converted to a string and that is where the "[object HTMLTableElement]" comes from.

Install Firebug and inspect the element. Do you see a title in the text? Check the DOM attributes. Maybe you can spot it there? Or maybe some JavaScript does not work properly. You'll get that message if you do an alert(document.createElement('th')); .

Probably this:

cell.title = cell;

which can be described as a failed attempt to store the reference to the cell inside its own title property (which holds the string that is shown inside the tooltip on mouse-over).

Live demo: http://jsfiddle.net/VwYRP/

Object references - when coerced to strings - usually look like so: '[object Constructor]' , where Constructor is the constructor function which the browser uses to instantiate that object.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM