<script type="text/javascript">
$(document).ready(function() {
$("#fileUp").ajaxForm({
success: complete, // post-submit callback
dataType: 'json'
})
function complete(data){
//alert(data);
if (data.status=='success'){
alert(data.info); //成功信息
$("#img",window.parent.document).html('<img src="<?php echo base_url()?>public/uploads/'+data.img+'"/>');
}else{
alert(data.info); //失败信息
}
}
});
</script>