Home Client Side Scripting jQuery Mobile
“jQuery Mobile frequently Asked Questions in various jQuery Mobile job Interviews by interviewer. The set of questions here ensures that you offer a perfect answer posed to you. So get preparation for your new job hunting”
77 JQuery Mobile Questions And Answers
Pages normally don't have a fixed height.
If you set a page or some element on a page to a fixed height using CSS, then you can size things in terms of %.
Here's one way to get the device height:
var viewportHeight = document.documentElement.clientHeight;
Here's another (that I haven't tried, but should work) because jQuery Mobile sets the device height as min-height CSS for the page. (And assuming you already have a $page variable with the page.)
var viewportHeight = parseFloat($page.css('min-height'));
Then, you can:
$page.height(viewportHeight + 'px');
3⟩ Explain CDN?
A content delivery network or content distribution network (CDN) is a large distributed system of servers deployed in multiple data centers across the Internet. The goal of a CDN is to serve content to end-users with high availability and high performance.
jQuery library comes in 2 different versions:
The production version is quite useful at development time as jQuery is open source and if you want to change something then you can make those changes in production version. But the deployment version is minified version or compressed version so it is impossible to make changes in it. Because it is compressed, so its size is very less than the production version which affects the page load time.
Get the value of an attribute for the first element in the set of matched elements. Whereas,.prop(): (Introduced in jQuery 1.6) Get the value of a property for the first element in the set of matched elements.
► Attributes carry additional information about an HTML element and come in name="value" pairs. Where Property is a representation of an attribute in the HTML DOM tree. once the browser parse your HTML code ,corresponding DOM node will be created which is an object thus having properties.
The .delegate() method behaves in a similar fashion to the .live() method, but instead of attaching the selector/event information to the document, you can choose where it is anchored and it also supports chaining.
Document.ready() function is different from body onload() function for 2 reasons.
► We can have more than one document.ready() function in a page where we can have only one body onload function.
► Document.ready() function is called as soon as DOM is loaded where body.onload() function is called when everything gets loaded on the page that includes DOM, images and all associated resources of the page.
jQuery library comes in 2 different versions Production and Deployment. The deployment version is also known as minified version. So .min.js is basically the minified version of jQuery library file. Both the files are same as far as functionality is concerned. but .min.js is quite small in size so it loads quickly and saves bandwidth.
It is possible using jQuery.noConflict().
As other client side libraries like MooTools, Prototype can be used with jQuery and they also use $() as their global function and to define variables. This situation creates conflict as $() is used by jQuery and other library as their global function. To overcome from such situations, jQuery has introduced jQuery.noConflict().
// Use jQuery via jQuery(...)
To start with jQuery, one need to make reference of it's library.
YES. We can have any number of document.ready() function on the same page.
Dollar Sign is nothing but it's an alias for JQuery. Take a look at below jQuery code.
Over here $ sign can be replaced with "jQuery" keyword.
The starting point of jQuery code execution is $(document).ready() function which is executed when DOM is loaded.
Client side scripting.
No. jQuery is not a W3C standard.
Due to following advantages:
► Easy to use and learn.
► Easily expandable.
► Cross-browser support (IE 6.0+, FF 1.5+, Safari 2.0+, Opera 9.0+)
► Easy to use for DOM manipulation and traversal.
► Large pool of built in methods.
► AJAX Capabilities.
► Methods for changing or applying CSS, creating animations.
► Event detection and handling.
► Tons of plug-ins for all kind of needs.