Why src attruibute wont render files at localhost

杀马特。学长 韩版系。学妹 提交于 2019-12-13 10:29:27

问题


I have a working program where images and files are loaded using src="http://localhost/some-path". When I visit application from phone, it cant load/find any of the files. The application renders perfectly on every desktop I have tried. Why is it that my iPhone doesn't like the localhost in the url?

<link rel="stylesheet" href="http://localhost/Ziroid_Functions/Clovis_App/public/clovisapp.css"> 

<div class="left"><img src="http://localhost/Ziroid_Functions/Clovis_App/public/img/doubleUp.png" alt="Smiley face" ></div>

<script type="text/javascript" src="http://localhost/Ziroid_Functions/Clovis_App/public/jsmpeg.min.js"></script>

Is it because phones are not capable of understanding localhost path? Does Apache2 have to be installed to interrupt localhost? Or is localhost a Desktop/laptop thing only?


回答1:


Localhost does not work (normally) from phones, because they have no web server installed. In order to view web content, a web server is required.



来源:https://stackoverflow.com/questions/54245195/why-src-attruibute-wont-render-files-at-localhost

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!