On localhost
my website is working fine. After uploading it to the hosting server some Functions are not working. Some pictures are not being displayed while others from the same folder are.
But every function is working and every picture is being displayed on localhost
.
For example, the following code is not working on the server. If you select an image in the input field, it will show you preview of the image
/* The uploader form */
$(function() {
$(':file').change(function() {
if (this.files && this.files[0]) {
var reader = new FileReader();
reader.onload = imageIsLoaded;
reader.readAsDataURL(this.files[0]);
}
});
});
function imageIsLoaded(e) {
$('#myImg').attr('src', e.target.result);
$('#yourImage').attr('src', e.target.result);
}
/* Image Designing Propoerties */
.thumb {
height: 75px;
margin: 10px 5px 0 0;
}
#myImg {
width: 30%;
height: auto;
}
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script><div id="thumbnail"></div><h5>Upload Your File Here: </h5><img id="myImg" src=""></br></br><input type='file' />