发布出来的HTML5网页如何本地打开呢?
construct2吧
全部回复
仅看楼主
level 5
我已经搭建了phoneGAP环境,结果发现直接生成的文件居然无法实现本地打开,这种问题如何解决呢?似乎生成的网页文件源码里有服务器环境检测,,@_@求解决,,,
2014年10月28日 07点10分 1
level 9
请用firefox或是IE浏览器打开. chrome会检查是否是本地端.
2014年10月28日 07点10分 2
但是发布在安卓端的话是不能选择的。话说我在代码中发现了弹出的那段代码,应该如何修改呢?
2014年10月28日 08点10分
回复 q575405657 :H5导出直接点哪个网页文件就能打开啊 ,分享的话 直接放在个人ftp里
2014年10月28日 10点10分
回复 yanyandd00 :恩恩,我知道,我是想看看能不能自己部署phoneGAP里~
2014年10月29日 04点10分
level 14
导出html5需要在web环境下使用,导出android或者phonegap才在phonegap环境下用,虽然html5源码可以在phonegap环境中使用,但是使用c2的phonegap导出直接免配置xml文件了.
2014年10月28日 11点10分 3
导出的html5源码不能直接双击打开,源码里有一句禁止file://协议的代码,所以必须要放在web环境中,iis或者apache,nginx等等等等
2014年10月28日 11点10分
level 5
我看到那段代码了~
<script>
// Issue a warning if trying to preview an exported project on disk.
(function(){
// Check for running exported on file protocol
if (window.location.protocol.substr(0, 4) === "file")
{
alert("Exported games won*t work until you upload them. (When running on the file:/// protocol, browsers block many features from working for security reasons.)");
}
})();
</script>
直接删掉就可以了,但是对于chrome内核还是不会自动显示出来~我在想想办法吧~谢谢大家~ @罗曼T克
2014年10月29日 04点10分 4
没看到这段代码,这段代码在哪个文件打开?data.js,jquery-2.1.1.min.js都没找到
2017年09月14日 09点09分
@puck560301 好几年的坟贴了,装个nginx服务器好了
2017年09月14日 10点09分
1