代码如下
<input id='inputFile' type="file">
<img id='showa' src="img/userpic_moren.png" alt="">
<img id='showb' src="img/userpic_moren.png" alt="">
$('#inputFile').on('change', function(){
var a = $('#inputFile')[0].value,
b = window.URL.createObjectURL($('#inputFile')[0].files.item(0));
$('#showa').attr('src', a);
$('#showb').attr('src', b);
})
我想问一下 a和b的区别在哪?
相关分类