this is inside javascript file
what happenes if i have the same bindings for the same div defined twice //
$(document).ready(开发者_如何学Gofunction() {
$("#divid").click(function() {
// some logic here
});
});
this is as inline
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$("#divid").click(function() {
// some logic here
});
});
</script>
The result will be that both handlers will run, in the order they were bound (unless the first interrupts the event, e.g. return false
).
The order they're bound is the order the <script>
elements occur in, since .ready()
handlers are also queued in order.
精彩评论