为什么src attruibute不会在本地主机渲染文件 [英] Why src attruibute wont render files at localhost
问题描述
我有一个工作程序,其中使用src ="http://localhost/some-path"加载图像和文件.当我通过电话访问应用程序时,它无法加载/查找任何文件.该应用程序可以在我尝试过的每个桌面上完美呈现.为什么我的iPhone不喜欢URL中的本地主机?
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>
是因为电话不能够理解本地主机路径吗?是否必须安装Apache2才能中断localhost?还是localhost仅是台式机/笔记本电脑?
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?
推荐答案
Localhost无法在电话上正常运行,因为它们未安装Web服务器.为了查看Web内容,需要Web服务器.
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.
这篇关于为什么src attruibute不会在本地主机渲染文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!