Opened 12 years ago

Last modified 12 years ago

#9596 closed defect

dojo._isButtonTag throwing exception — at Version 2

Reported by: Douglas Hays Owned by: sjmiles
Priority: high Milestone: 1.4
Component: Core Version: 1.3.2
Keywords: Cc: James Burke
Blocked By: Blocking:

Description (last modified by Douglas Hays)

Calling dojo.marginBox(node, {}) with an INPUT node having no explicit type will cause an exception thrown in _isButtonTag since getAttribute("type") returns null on Firefox and Safari.

<HTML>
<HEAD>
        <SCRIPT type="text/javascript" djConfig="parseOnLoad:false, isDebug:true" src="http://o.aolcdn.com/dojo/1.3.1/dojo/dojo.xd.js"></SCRIPT>
</HEAD>
<BODY>
<INPUT id="textbox" size="60" value="testing...">
<SCRIPT type="text/javascript">
        var textbox = dojo.byId('textbox');
        try{
                dojo.marginBox(textbox,{})
                textbox.value = 'No error';
        }catch(e){ textbox.value = e.message; }
</SCRIPT>
</BODY>
</HTML>

The fix to _isButtonTag is simple:

(node.getAttribute("type")||'')

Change History (2)

comment:1 Changed 12 years ago by Douglas Hays

Cc: James Burke added
Owner: changed from anonymous to sjmiles

original code added in [14386]

comment:2 Changed 12 years ago by Douglas Hays

Description: modified (diff)
Note: See TracTickets for help on using tickets.