1
votes

I have tested the code which is in http://api.jquerymobile.com/loader/ .

    <!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>loader demo</title>
<link rel="stylesheet" href="//code.jquery.com/mobile/1.4.4/jquery.mobile-1.4.4.min.css">
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="//code.jquery.com/mobile/1.4.4/jquery.mobile-1.4.4.min.js"></script>
</head>
<body>
<div data-role="page" id="page1">
<div role="main" class="ui-content">
<div data-role="controlgroup">
<button class="show-page-loading-msg" data-theme="b" data-textonly="false" data-textvisible="false" data-msgtext="" data-icon="arrow-r" data-iconpos="right">Default loader</button>
<button class="show-page-loading-msg" data-theme="b" data-textonly="true" data-textvisible="true" data-msgtext="Text only loader" data-icon="arrow-r" data-iconpos="right">Text only</button>
<button class="show-page-loading-msg" data-theme="b" data-textonly="false" data-textvisible="true" data-msgtext="Loading theme a" data-icon="arrow-r" data-iconpos="right">Theme a</button>
<button class="show-page-loading-msg" data-theme="a" data-textonly="false" data-textvisible="true" data-msgtext="Loading theme b" data-icon="arrow-r" data-iconpos="right">Theme b</button>
<button class="show-page-loading-msg" data-theme="b" data-textonly="true" data-textvisible="true" data-msgtext="Custom Loader" data-icon="arrow-r" data-html="<span class='ui-bar ui-overlay-a ui-corner-all'><img src='../_assets/images/jquery-logo.png' /><h2>is loading for you ...</h2></span>" data-iconpos="right">Custom HTML</button>
<button class="hide-page-loading-msg" data-icon="delete" data-iconpos="right">Hide</button>
</div>
</div>
</div>
<script>
$(document).on( "click", ".show-page-loading-msg", function() {
var $this = $( this ),
theme = $this.jqmData( "theme" ) || $.mobile.loader.prototype.options.theme,
msgText = $this.jqmData( "msgtext" ) || $.mobile.loader.prototype.options.text,
textVisible = $this.jqmData( "textvisible" ) || $.mobile.loader.prototype.options.textVisible,
textonly = !!$this.jqmData( "textonly" );
html = $this.jqmData( "html" ) || "";
$.mobile.loading( 'show', {
text: msgText,
textVisible: textVisible,
theme: theme,
textonly: textonly,
html: html
});
})
.on( "click", ".hide-page-loading-msg", function() {
$.mobile.loading( "hide" );
});
</script>
</body>
</html>

First created the phonegap app using phoegap create command.Then added the css file which is in the (//code.jquery.com/mobile/1.4.4/jquery.mobile-1.4.4.min.css).Added the js files in js folder(//code.jquery.com/jquery-1.10.2.min.js,//code.jquery.com/mobile/1.4.4/jquery.mobile-1.4.4.min.js).Then ran the application using phonegap run android.After installed the apk in mobile.The loading icon is not showing well.The white loader inside the black round is not displaying.Can anyone help me to fix ?enter image description here

2

2 Answers

1
votes

For me, the problem was that the css file for JQuery mobile had something like

.ui-icon-loading{background:url("../../../../../Downloads/ajax-loader.gif")

Which is honestly nonsense, so I fixed it to

.ui-icon-loading{background:url(ajax-loader.gif)
0
votes

I also have the same issue.I overcame that by putting image folder in css folder which contains ajax-loader.gif and some default icons.