此代码会在页面加载时触发,但不会在实际发生更改事件时触发。
jQuery('select#order_note_type').change(function() {
//random code here
});
我必须补充一点,它不在ready
方法内。我需要绑定吗?
编辑:我将代码更改为内部$(document).ready()
并使用绑定,但我仍然让我的方法仅在页面加载时触发:
jQuery(document).ready(onReady);
function onReady() {
jQuery('select#order_note_type').bind('change',showTrackingInfo);
}