Progress bar loading message doesn't show in JQuery mobile - jquery-mobile

The Loading message in JQuery Mobile 1.1.0 doesn't seem to be working. Here is the JSFiddle for the code.
When I use version 1.0b2, it works as expected. Is this a bug in 1.1.0?

It is not a bug. Latest Jquery supports more config options. You can define the laoding message theme etc.
Refer the documentation here
Sample code
$(document).bind("mobileinit", function(){
$.mobile.loadingMessageTheme = 'a';
$.mobile.loadingMessageTextVisible = true;
});
Save above mentioned code in a js file (e.g. config.js ) and import it before importing jquerymobile framwork.
Good luck.

Related

Firefox sdk styles-file works only partially

I am making firefox addon and I cann't manages styles to show correctly. For example, links color are always what page defines:
main.js:
pageMod.PageMod({
contentStyleFile: self.data.url("style.css"),
contentScriptFile: [self.data.url("jquery.js"), self.data.url("script.js")]
style.css:
#div_id {background:green}
#div_id a.black {color:black}
script.js:
$('body').append("<div id='div_id'><a class='black' href='#'>link</a></div>");
The result is: background:green is working, but #div_id a.black {color:black} is not working.
Page define a color and addon css-file can't change it. The only way to do it is $('#div_id a.black').css({'color':'black'})
What is wrong with addons css files? Why they are working only partially?
I will use this:
var styles = "#div_id {background:green}\
#div_id a.black {color:black}";
$("head").append("<style>"+styles+"</style>");
It is ugly, but it works.

Uploadify conflict with jQuery dialog

I have trying to create file upload using jQuery-UI dialog and uploadify. I have seen that others also had similar problem, but it was always z-index in css or cross-browser issue, which is not case here because it just won't work in any browser. When I place uploadify div(div that is a placeholder for flash object) outside the jQuery dialog everything works fine, but when I try to put it inside, swf gets loaded but when dialog pops I get error: 'Object expected' in jquery.min.js on
var c=a.getAttributeNode("tabindex")
Is it possible that problem is caused by jquery version? Current version is 1.7.1 and I tried using also 1.9.0
Add the following CSS class to override the default z-index value 1
.swfupload {
z-index: 10000 !important;
}
this error in absence function getAttributeNode and getAttribute in Flash element.
change in "jquery-min.js"
elem.getAttributeNode(name) // OR a.getAttributeNode(b)
to
(elem.getAttributeNode?elem.getAttributeNode(name):null) // OR (a.getAttributeNode?a.getAttributeNode(b):null)
and
elem.getAttribute(name) // OR a.getAttribute(b)
to
(elem.getAttribute?elem.getAttribute(name):null) // OR (a.getAttribute?a.getAttribute(b):null)

Why isn't jquery working in Rails 3.1?

If I go to http://localhost:3000/assets/application.js my code (which works fine in 3.0) exists, because I've referenced it fine in the new application.js assets pipeline file:
$(document).ready
(function(){
$('input.ui-date-picker').datepicker({
dateFormat: 'dd-mm-yy'
});
});
But it's not being called. Jquery is present, too, and my gemfile got upgraded ok. What could be wrong?
OK, the problem was that I had a number of bits of code within a .js file I'd called various.js, and not all of them were wrapped in $(document).ready... }); Once I added that to each separate bit of code it worked fine. Also, I have to restart the server each time I make a change to the .js file - just touching it doesn't work for me. I found a simple Hello World alert really useful in debugging this (just in case anyone out there is as new to jquery as me!):
$(document).ready(function() {
alert("Hello world!")
});

Jquery Mobile pageLoading() Method how does it work?

I am new to Jquery Mobile and attempting to learn it as I redevelop this mobile site. So I am doing all my navigation with different divs with data-role="page". and navigating with the #pagename. My question being doing my navigation this way how do I use the loading message and wait to make the transition until the next page is loaded? I tried putting the $.mobile.pageLoading() in the onClick attribute of the link but that didn't work.
Using JQM 1.0 beta 1
//show
$.mobile.showPageLoadingMsg();
//hide
$.mobile.hidePageLoadingMsg();
http://jquerymobile.com/demos/1.0b1/#/demos/1.0b1/docs/api/methods.html
http://jquerymobile.com/test/docs/api/methods.html
Update:
This method is also the accepted way to do it in the official 1.0 release.
http://code.jquery.com/mobile/latest/demos/docs/api/methods.html
mobile.showPageLoadingMsg ()
Show the page loading message, which is configurable via $.mobile.loadingMessage.
Example:
//cue the page loader
$.mobile.showPageLoadingMsg();
$.mobile.hidePageLoadingMsg ()
Hide the page loading message, which is configurable via $.mobile.loadingMessage.
Example:
//cue the page loader
$.mobile.hidePageLoadingMsg();
The documentation is here (at the bottom) http://jquerymobile.com/demos/1.0a4.1/#docs/api/methods.html but yeah it's a little vague on examples.
This might help you out: https://github.com/jquery/jquery-mobile/issues/1397
In jQuery mobile 1.4.5 the only thing that helped me is:
$('.ui-loader').hide();

error on firefox: $.widget is not a function

I have a few multiselect boxes from the Jquery UI on a page that work perfectly well in Chrome & Safari but not in Firefox for some reason... when I load the Error Console in Firefox I see:
Error: $.widget is not a function
Source File: http://localhost:3000/javascripts/jquery.multiselect.js?1302660373
Line: 563
Any ideas why?
edit: the line itself is within the open function right where it says "// react to option changes after initialization"
// open the menu
open: function(e){
var self = this,
button = this.button,
menu = this.menu,
speed = this.speed,
o = this.options;
widget: function(){
return this.menu;
},
// react to option changes after initialization
_setOption: function( key, value ){
var menu = this.menu;
switch(key){
case 'header':
menu.find('div.ui-multiselect-header')[ value ? 'show' : 'hide' ]();
I am assuming you are using the jQuery Multiselect plugin… which depends on jQuery UI.
Sounds like you have not included enough of the jQuery UI library or just none of it. You need to include the core parts of jQuery UI (including Widget) if you build a custom download. Or just download the whole jQuery UI and include it instead.
For anyone else who is getting this but has the requirements; make sure you are including the Javascript files in the correct order. This error was being caused by my jquery-ui.js being included after the multiselect js file.
This answer is probably unrelated to the situation of the questioner, but I put it here for the sake of others Googling the question.
I got this error using Rails 3.2 and fixed it by deleting (renaming) the public/assets folder. It seems there are a lot of problems with the assets pipeline still. I don't know the details but have had other Javascript failures that are fixed this way.
Actually if you are getting this error then it's either
a) per #andyb answer - you haven't included the correct jQuery UI components
OR
b) your DOM is not loaded yet with the correct $.widget and therefore your function is attempting to call before $.widget has loaded. to fix the problem, ensure $.widget is called BEFORE your function

Resources