在 iphone/ipad 上测试本地网页
我的 win7 机器上运行着一个 Apache Web 服务器,它链接到我的硬盘上的某个本地文件夹。我制作了一个移动网站,我可以轻松地从我的计算机访问它(通过网络服务器)。然而,当我尝试从 iPhone 或 iPad 设备访问它时,我设法很好地浏览文件,甚至打开图像和 .js 文件,但当我尝试打开网页时,90% 的时间会超时,而其他 10% 的时间会超时。 %的时间它倾向于以非常奇怪的方式呈现(就好像js文件的css没有被加载一样。)
我本以为某处存在路径错误,但在Apache日志中我看到所有链接的文件都被完美地访问(即获取/Crash%20Test/test2.htm HTTP/1.1" 200 1338)。
我对网络服务器和网络不太熟悉,所以任何帮助将不胜感激!
谢谢, 马特
I have an Apache webserver running on my win7 machine that links to some local folder on my hdd. I made a mobile website and i can easily access it from my computer (by going through the webserver). However when i try to access it from my iphone or ipad device, i manage to browse through the files fine, even open images and .js files but when i try open the webpage 90% of the time it times out, and the other 10% of the time it tends to render in very odd ways (as if css of js files are not being loaded.)
I would have thought there was a path error somewhere but in the Apache log i see all the linked files being accessed perfectly fine (i.e GET /Crash%20Test/test2.htm HTTP/1.1" 200 1338).
I'm not that familiar with web servers and networking, so any help would be greatly appreciated!
Thank you,
Matt
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查你的 html,可能缺少关闭标签或类似的愚蠢内容。
IE 非常宽容,因此它可能会在您的电脑上正确显示,但在 safari 上却不会。
另请检查您 PC 上的 safari(启用开发人员工具),看看是否出现任何警告或错误。华泰
Check your html, could be missing a close tag or something silly like that.
IE is VERY forgiving, so it may appear correctly on your pc, but on safari it wont.
Also check with safari on your PC (enable developer tools) and see if any warnings or errors are given. HTH
由于您没有提供部署图,让我尝试考虑以下假设
如果全部上述假设都是正确的。转至安装 Web 服务器的计算机上的命令提示符并键入 ipconfig。
记下您的 IP 地址。现在,在您的移动设备上,将 localhost 一词替换为 IP 地址,并在斜杠后添加站点文件夹的名称。
例如,如果是
localhost/nameofsitefolder
,请将其更改为xxx.xxx.xxx。 xxx/站点文件夹名称
As you have not provided deployment diagram, let me try by considering following assumptions
If all of the above assumptions are correct. Go to Command Prompt on the computer where the Webserver is installed and type ipconfig.
Make a note of your IP Address. Now on your mobile device replace the word localhost with the ipaddress and add the name of site folder after a slash
For example, if it is
localhost/nameofsitefolder
change it toxxx.xxx.xxx.xxx/nameofsitefolder