JQuery mobile 1.3.2 : $.mobile.loading 停止在 iOS 上工作

JQuery mobile 1.3.2 : $.mobile.loading stopped working on iOS

本文关键字:mobile iOS 工作 JQuery loading      更新时间:2023-09-26

我无法正常工作$.mobile.loading...它工作了很长时间,并且由于我已经将iOS更新到最新版本(9.x),因此它部分工作。我的意思是,有时它确实有效并且显示加载消息,但大多数时候它不显示任何内容。我正在运行iOS 9.1.3,并在Safari和Firefox iOS上进行了测试。

我已经在仍在ios 4上运行的旧iPhone 6.x上进行了测试,并且加载程序工作正常!

此外,它在Android下工作。在我的电脑上测试了它,它可以在Chrome和Firefox上运行,但不能在Safari上运行。

在最新版本的Safari/iOS上是否有涉及jQuery/jQuery Mobile的已知错误?

这是我的代码:

function showLoadingPage() {
    $('body').append("<div class='ui-loader-background' onClick='$.mobile.loading('"hide'");'> </div>"); //Fond opaque lors du chargement
    var $this = $( this ),
        //theme = $this.jqmData("theme") || $.mobile.loader.prototype.options.theme,
        theme = "b",
        //msgText = $this.jqmData("msgtext") || $.mobile.loader.prototype.options.text,
        msgText = "Chargement ...",
        //textVisible = $this.jqmData("textvisible") || $.mobile.loader.prototype.options.textVisible,
        textVisible = true,
        textonly = !!$this.jqmData("textonly"),
        html = $this.jqmData("html") || "";
    $.mobile.loading( 'show', {
            text: msgText,
            textVisible: textVisible,
            theme: theme,
            textonly: textonly,
            html: html
    });
}
$(document).on("click", ".show-page-loading-msg", function() { showLoadingPage(); });

当我点击一个类为show-page-loading-msg的链接时,它应该会触发$.mobile.loading

添加一个小延迟以帮助加载程序显示。

setTimeout(function() {     
  $.mobile.loading('show');
}, 10);