jQuery: Fixing Event with jQuery.event.fix

October 18th, 2008 by jeremychone

If you want to use the traditional HTML event binding and still use jQuery, here is a quick tip to get a “clean” (i.e. cross browsers) html event using jQuery.event.fix:

<input type=”file” name=”photoFile” onchange=”upload(event)”/>
<script>

function upload(e){
var e = $.event.fix(e);
alert(”target: ” + e.target);
}

</script>

Leave a Reply