0

これは私が以前に遭遇した問題であり、なぜそれが起こるのかはまだわかりません.

問題のページはhttp://nexrem.com/dragontimer/testdir/mobile/index.htmlです。

[サーバーの選択] ボタンを押すと、そこにあるはずのコンテンツがページに表示され、その後空白になります。これを修正できることを私が知っている1つの方法はdata-ajax="false"、リンクに追加することです。ただし、そうすると、別の問題が発生します。iPhoneでページをホーム画面に追加して実行すると、[サーバーの選択]をクリックすると、Webアプリ内にとどまる代わりにブラウザーが開きます。

私の目標は、ユーザーがホーム画面にページを追加できるようにすることです。URL バーはなく、すべてのページを内部から実行できます。持つこと<meta name="apple-mobile-web-app-capable" content="yes" />data-ajax="false"一緒にすることがうまくいかないようです。

したがって、基本的に2つのこと:

  • 画面の点滅と空白の表示を修正するにはどうすればよいですか (更新しない限り)
  • または、ユーザーがボタンをクリックするたびにブラウザーを開かずに、ツールバーのない Web アプリを使用するにはどうすればよいですか?

ありがとうございました

編集:これはindex.htmlとservers.htmlのコードです

index.html - http://pastebin.com/Qh5s7QRp

servers.html - http://pastebin.com/Exv2MJrS

4

1 に答える 1

1

In your file index.html, include rel="external" instead of data-ajax="false" inside the definition of your link Select server.

So, you should have this instead:

<a href="servers.html" data-role="button" data-theme="c" rel="external">Select server</a>

You may also need to replace every data-ajax="false", that you included in the <a> links of both your HTML files index.html and servers.html, with rel="external".


Check the online doc for more information about rel="external" at http://jquerymobile.com/test/docs/pages/page-links.html :

Links that point to other domains or that have rel="external", data-ajax="false" or target attributes will not be loaded with Ajax. Instead, these links will cause a full page refresh with no animated transition. Both attributes (rel="external" and data-ajax="false") have the same effect, but a different semantic meaning: rel="external" should be used when linking to another site or domain, while data-ajax="false" is useful for simply opting a page within your domain from being loaded via Ajax. Because of security restrictions, the framework always opts links to external domains out of the Ajax behavior.

Hope this helps.

于 2012-10-11T05:30:13.633 に答える