I'm getting 'this.0.files.0' is null or not an object error on IE8 and IE9 and Chrome and Mozila don't throw any errors .
$(function()) {
var fileType = ['txt' , 'csv' ];
$('.input_file').find('input [type = "file" ]').live('change', function (e)) {
$this = $(this)
var ext = $this.val() === " " ? " " : this.value.match(/\.(.+)$/)[1];
if($this.val()) {
$this.parent().find('label').text.($this[0].files[0].name)
}
}
}
Im not sure why above code throws a javascript error 'this.0.files.0' is null or not an object
$this = $(this)
is missing a semi-colon.var
to make it a local variable