Skip to main content

Bug Tracker

Side navigation

#6109 closed bug (duplicate)

Opened February 17, 2010 10:14AM UTC

Closed November 09, 2010 03:10AM UTC

Last modified November 09, 2010 03:10AM UTC

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>

Attachments (0)
Change History (4)

Changed February 17, 2010 10:18AM UTC by Lathe comment:1

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>

Changed June 04, 2010 09:25AM UTC by svcorp77 comment:2

Sudgestion:

Dont use inline javacript ("onClick") on element

just bind it in scripts

$(element)

.bind('click', Test);

Changed November 09, 2010 03:10AM UTC by snover comment:3

priority: → undecided
resolution: → duplicate
status: newclosed

Changed November 09, 2010 03:10AM UTC by snover comment:4

Duplicate of #6593.