如何将启动文件index.html更改为phonegap中的其他html文件

时间:2018-10-17 05:51:03

标签: cordova jquery-mobile phonegap-build phonegap phonegap-cli

如何在phonegap中将启动文件index.html更改为其他html文件。我在config.xml文件中更改了内容src =“ login.html”,但是它不起作用。它总是加载index.html文件。请帮忙。非常感谢。

  

config.xml

<content src="login.html" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="14" />
<access origin="" />
<allow-intent href="http://*/" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>

1 个答案:

答案 0 :(得分:0)

不知道为什么要启动除index.html之外的其他页面(将login.html重命名为index.html会更容易吗?)

无论如何,您可以做的是创建一个最小的index.html文件,该文件可以通过添加如下所示的脚本标签重定向到login.html:

   <script>
        window.location = './login.html';
    </script>

这就是我在应用程序中使用的东西,因为如果index.html启动时间太长,cordova可能会拒绝启动该应用程序。

相关问题