Hi,

it seems that there is an inconsistent behavior when jQuery(...).bind and
Element.on<event> = function are used.
When I add a click event for a button with Button.onclick and afterwards a
jQuery(Button).bind("click"),
both functions are triggered when the button is clicked.

If I do the same with a window.onload and the jQuery(...).bind, just the
jQuery function will fire.
I can't use jQuery().ready, because my function has to fire after the
existing function and I can also
not change the window.onload call, because that is generated by some other
code.
BTW, if the jQuery(window).bind("load") call is removed, the original
function is fired again.

Thanks for your help
Patrick

Example:

<html>
<script type="text/javascript"
src="http://jquery.com/src/jquery-latest.js";></script>
<body>
<input type="button" value="Click me" id="clickme">
<script type="text/javascript">
// register onclick event
document.getElementById("clickme").onclick = function(){alert("button1");};
jQuery("#clickme").bind("click", function(){alert("button2");});
// register onload
window.onload = function(){alert("onload1");};
jQuery(window).bind("load", function(){alert("onload2");});
</script>
</body>
</html>
-- 
View this message in context: 
http://www.nabble.com/window.onload-not-executed-when-using-.bind%28%22load%22%29-tf3201862.html#a8890546
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to