Monday, 15 April 2013

javascript - onclick-event doesn't work in Firefox - works in Internet Explorer -



javascript - onclick-event doesn't work in Firefox - works in Internet Explorer -

i've implement onclick event called: remove(this). works fine in net explorer, not in firefox. set breakpoint on remove function, saw ie phone call function , ff doesn't. (debugged firebug , ie developertools)

internet explorer:

<input onclick="remove( )" id=nbgtest-1075_0002__update__deletebutton title="remove spawn" class="update field-button" type=button value=delete name=nbgtest-1075_0002__update__spawnbutton>

firefox:

<input id="nbgtest-1075_0005__update__deletebutton" class="update field-button" type="button" onclick="remove( )" value="delete" title="remove spawn" name="nbgtest-1075_0005__update__spawnbutton">

the input button have same parameters order different, shouldn't error.

this program: theres button a. when button clicked, button b generated. button b can removed. function remove()- removes button again. when press delete button, button hide row still visible. row remove in remove() function

code of button (add-button):

ie:

<input onclick="add( )" id=nbgtest-1075_main__update__spawnbutton title="create spawn" class="update field-button" type=button value="add spawn" name=nbgtest-1075_main__update__spawnbutton>

ff:

<input id="nbgtest-1075_main__update__spawnbutton" class="update field-button" type="button" onclick="add( )" value="spawn mr" title="create spawn" name="nbgtest-1075_main__update__spawnbutton">

both browsers fires add(this) event.

i tested ie11 , ff 32.0.3

funny fact: when create net explorer tab in firefox, works!

the remove function:

function remove( button ) { if( isbutton( button ) && isupdatesection( button.id ) ) { //here remove button/row } return( false ); }

i fixed it. changed function name remove() in removes(). presumably, remove() internal javascript function , firefox utilize function. instead net explorer detects defined own remove() function.

javascript html internet-explorer firefox dom

No comments:

Post a Comment