Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 创建JQM自定义加载消息_Jquery_Jquery Mobile - Fatal编程技术网

Jquery 创建JQM自定义加载消息

Jquery 创建JQM自定义加载消息,jquery,jquery-mobile,Jquery,Jquery Mobile,我在下面有一条Jquery移动加载消息: $.mobile.showPageLoadingMsg("a", "Fetching Operators"); 但我想这样做, $.mobile.showPageLoadingMsg("a", "<div class='clearfix'>Fetching Operators</div><a href='default.aspx'>Use Simple Site</a>"); $.mobile.show

我在下面有一条Jquery移动加载消息:

$.mobile.showPageLoadingMsg("a", "Fetching Operators");
但我想这样做,

$.mobile.showPageLoadingMsg("a", "<div class='clearfix'>Fetching Operators</div><a href='default.aspx'>Use Simple Site</a>");
$.mobile.showPageLoadingMsg(“a”,“获取运营商”);
因此,如果用户连接速度较慢,他们可以选择单击指向simply站点的链接

但是HTML不会呈现,而是全部显示为文本。谁能告诉我如何实现上述目标

非常感谢你的帮助


关于Devin,jQuery Mobile在默认情况下似乎不允许使用HTML(最有可能在内部使用
.text()
方法,而不是
.HTML()
方法),而且每次调用
$.Mobile.loading()
方法(您正在运行的方法的新版本)时,它看起来也一样加载程序的文本被重置

以下是jQuery Mobile 1.2的快速(肮脏)解决方案:

//show the loader, specifying to show the text message
$.mobile.loading( 'show', { textVisible : true } );

//now find the loader widget, find the text within it, and then set it's HTML
$("body").find(".ui-loader").find("h1").html("<div class='clearfix'>Fetching Operators</div><a href='default.aspx'>Use Simple Site</a>");
//显示加载程序,指定显示文本消息
$.mobile.loading('show',{textVisible:true});
//现在找到loader小部件,找到其中的文本,然后将其设置为HTML
$(“body”).find(“.ui加载器”).find(“h1”).html(“获取运算符”);

这里有一个演示:

大家好。谢谢你的回复。我一直在尝试复制您的解决方案,但出于什么原因,我运行JQM 1.2.0的站点不会显示您的解决方案。它仅显示带有“装载”字样的装载机轮。好像它忽略了你的第二行。你知道为什么吗?在检查时,我可以看到你的第二行没有被应用:Loading发现了问题。在ASPX中有一个表单元素,它是直接的子元素。因此,为了使我的aspx页面工作,我只需要将“body”更改为“form”。。。太好了,谢谢你@user1434739感谢您更新您的进度。我没有想到ASPX会如何添加
表单
元素,我相信其他框架也会添加类似的HTML结构。我将代码更新为使用
.find()
而不是
.children()
。出于兴趣,此更改是否会导致潜在的性能损失?