菜鸟教程小白 发表于 2022-12-12 10:17:02

javascript - 如何在适用于 ios 7 的 Cordova 3.9.2 中删除 index.html


                                            <p><p>这是在 cordova 应用程序中显示的警报</p>

<pre><code>alert(&#34;welcome to all&#34;);
</code></pre>

<p>当我在 ios 7 中运行应用程序时,它会显示 </p>

<pre><code>index.html
welcome to all
</code></pre>

<p>要删除 <code>index.html</code> 我使用了 cordova 插件 <code>cordova-plugin-dialogs</code> </p>

<pre><code>document.addEventListener(&#34;deviceready&#34;,alert,false);
function alert(){
navigator.notification.alert(&#34;welcome to all&#34;);
}
</code></pre>

<p>但它不适合我</p>

<p>请告诉我们一些细节,以便在 ios cordova 应用程序中显示 native 警报。</p>

<p>注意:
在这里,我没有调用任何原生功能,完全是用 HTML 和 JavaScript 开发的应用程序。只是我们维护了 <code>platforms/ios/www 文件夹</code> 中的所有内容。当我开始在 iPhone 6 设备或模拟器上运行应用程序时,它会根据 <a href="https://www.dropbox.com/s/st5jpq4r0hq0fqk/alert.png?dl=0" rel="noreferrer noopener nofollow">https://www.dropbox.com/s/st5jpq4r0hq0fqk/alert.png?dl=0</a> 显示警报</p>

<p>最近当我执行应用程序时,
我收到的消息</p>

<blockquote>
<p>The old format of this exec call has been removed (deprecated since
2.1). Change to: cordova.exec(null, null, &#34;&#34;, &#34;&#34;,[null,&#34;Notification&#34;,&#34;alert&#34;,[&#34;HI am doing testing in alert&#34;,&#34;Good
Job1&#34;,&#34;Okay1&#34;]]);</p>
</blockquote></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>要解决在警报中加载的标题名称,
我们也可以通过在javascript中使用自定义插件来使用另一种方法,所以不需要使用<code>cordova plugins</code>。</p>

<p>在我的应用程序中,我使用了 <code>SweetAlert</code> javascript 插件。</p>

<p><code>SweetAlert</code> 插件,您可以从此链接下载
         <a href="http://t4t5.github.io/sweetalert/" rel="noreferrer noopener nofollow">http://t4t5.github.io/sweetalert/</a> </p>

<p>将插件集成到我们的应用程序中非常容易。</p>

<p>整合后,我们就可以用这种格式传递消息了</p>

<pre><code>swal(&#34;Displaying new message using SweetAlert plugin&#34;);
</code></pre></p>
                                   
                                                <p style="font-size: 20px;">关于javascript - 如何在适用于 ios 7 的 Cordova3.9.2 中删除 index.html,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/35077684/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/35077684/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: javascript - 如何在适用于 ios 7 的 Cordova 3.9.2 中删除 index.html