将网站上传到服务器后,某些功能不起作用

localhost上,我的网站运行正常。将其上传到托管服务器后,某些功能无法正常工作。一些图片没有显示,而其他图片来自同一文件夹。

但是每个功能都在起作用,并且每张图片都显示在localhost上。

例如,以下代码在服务器上不起作用。如果您在输入字段中选择一张图片,它将显示该图片的预览

/* 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' />

gmaj1986 回答:将网站上传到服务器后,某些功能不起作用

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2987523.html

大家都在问