Bug Tracker

Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#6109 closed bug (duplicate)

Event rises at its binding in IE.

Reported by: Lathe Owned by:
Priority: undecided Milestone: 1.4.2
Component: event Version: 1.4.1
Keywords: onclick bind Cc:
Blocked by: Blocking:

Description

When I bind click event in onclick function, new event rises immediately, without element click. This bug or feature has placed in IE8, not in FireFox 3.5.7.

Exsample:

<a href="#" onclick="Test(this)">Test</a>

<script language="javascript">

function Test(element) {

This meessage must show all time.

alert("1");

var fn = function(event) {

This message must show only at second time, but in IE show all time. alert("2");

}; element.click(fn);

}

</script>

Change History (4)

comment:1 Changed 10 years ago by Lathe

Sorry, correct example:

<a href="#" onclick="Test(this)">Test</a> <script language="javascript">

function Test(element) {

This meessage must show all time. alert("1");

var fn = function(event) {

This message must show only at second time, but in IE it show all time. alert("2"); alert("2");

}; $(element).click(fn);

}

</script>

comment:2 Changed 10 years ago by svcorp77

Sudgestion: Dont use inline javacript ("onClick") on element just bind it in scripts $(element)

.bind('click', Test);

comment:3 Changed 9 years ago by snover

Priority: undecided
Resolution: duplicate
Status: newclosed

comment:4 Changed 9 years ago by snover

Duplicate of #6593.

Note: See TracTickets for help on using tickets.