Ques 1. What is jQuery?
Ans 1: jquery is javascript library which provides fast and easy way of HTML DOM traversing and manipulation required a jquery.js file. After that you can write the jquery as fallows. It uses "$" as the short hand to write jquery code.
Code Example
$(document).ready(function()
{
function body
});
Ques 2. How is body onload() function is different from document.ready() function used in jQuery?
Ans 2: Document.ready() function is different from body onload() function because off 2 reasons.
1. We can have more than one document.ready() function in a page where we can have only one onload function.
2. 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.
Ques 3. What is JQuery UI?
Ans 3: JQuery UI is a library which is built on top of JQuery library. JQuery UI comes with cool widgets, effects and interaction mechanism.
Ques 4. What are features of JQuery?
Ans 4: Features of Jquery
1. One can easily provide effects and can do animations.
2. Applying / Changing CSS.
3. Cool plugins.
4. Ajax support
5. DOM selection events
6. Event Handling
Ques 5. Name the 5 Jquery events?
Ans 5: jQuery Events
jQuery click() event.
jQuery dblclick() event.
jQuery mouseenter() event.
jQuery mouseleave() event.
jQuery mousedown() event.
jQuery mouseup() event.
jQuery hover() event.
jQuery focus() and blur() events.
Ques 6. What are the advantages of JQuery ?
Ans 6: There are many advantages with JQuery. Some of them are :
Ques 7. What does dollar Sign ($) means in JQuery?
Ans 7: Dollar Sign is nothing but it's an alias for JQuery. Take a look at below jQuery code
$(document).ready(function(){
});
Over here $ sign can be replaced with "jQuery " keyword.
jQuery(document).ready(function(){
});
Ques 8. What are the different type of selectors in Jquery?
Ans 8: There are 3 types of selectors in Jquery
1. CSS Selector
2. XPath Selector
3. Custom Selector
Ques 9. What is CDN?
Ans 9: CDN Stands for Content Distribution Network or also called Content Delivery Network is a group of computers placed at various points connected with network containing copies of data files to maximize bandwidth in accessing the data. In CDN a client access a copy of data nearer to the client location rather than all clients accessing
from the one particular server. This helps to achieve better performance of data retrieval by client.
There are two leading CDNs available that hosts jQuery files.
Microsoft - To load jQuery from Microsoft AJAX CDN
jQuery file can be loaded from Microsoft AJAX CDN. For more details, go to http://www.asp.net/ajaxlibrary/cdn.ashx. You will need to keep following tags in your page.
<script type="text/javascript" language="Javascript" src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.4.1.min.js"></script>
Google - To load jQuery from Google Libraries API
jQuery file can be loaded from Google CDN for more details, go to http://code.google.com/apis/libraries/devguide.html. You will need to keep following tag in your page.
<script type="text/javascript" language="Javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
Ques 10. Why to load jQuery file from CDN?
Ans 10 : You may ask that if we can load the jQuery file from our own server why to load it from the CDNs. The answer is logical and very simple. The browser behavior is that whenever it loads any webpage, it keeps related files (eg. Javascript file, CSS file and Images) used for that page into its cache (also called history). When next time the user browses any web page, browser loads only those files that are new or modified and is not available in the browser cache or history. In this way, browser improves its performance and loads the page.
The possibility is that if more and more websites are using CDNs, the user might have already browsed some other web pages that is using CDNs jQuery file and that file may have into browser cache; so when user browse your page and you are also using CDNs file, the older cached version of jQuery file will be used. In this way your page will load faster as browser will not have to load the jQuery file for your page again.
The benefit
1. Faster page load as jQuery file need not to be downloaded
2. Saves your bandwidth as jQuery file is not loaded from your server
3. Scalable - generally CDNs place these files on the servers located at different geographical locations of the world so that they load faster so irrespective of from where your user is browsing your page, your application runs well.
Ans 1: jquery is javascript library which provides fast and easy way of HTML DOM traversing and manipulation required a jquery.js file. After that you can write the jquery as fallows. It uses "$" as the short hand to write jquery code.
Code Example
$(document).ready(function()
{
function body
});
Ques 2. How is body onload() function is different from document.ready() function used in jQuery?
Ans 2: Document.ready() function is different from body onload() function because off 2 reasons.
1. We can have more than one document.ready() function in a page where we can have only one onload function.
2. 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.
Ques 3. What is JQuery UI?
Ans 3: JQuery UI is a library which is built on top of JQuery library. JQuery UI comes with cool widgets, effects and interaction mechanism.
Ques 4. What are features of JQuery?
Ans 4: Features of Jquery
1. One can easily provide effects and can do animations.
2. Applying / Changing CSS.
3. Cool plugins.
4. Ajax support
5. DOM selection events
6. Event Handling
Ques 5. Name the 5 Jquery events?
Ans 5: jQuery Events
jQuery click() event.
jQuery dblclick() event.
jQuery mouseenter() event.
jQuery mouseleave() event.
jQuery mousedown() event.
jQuery mouseup() event.
jQuery hover() event.
jQuery focus() and blur() events.
Ques 6. What are the advantages of JQuery ?
Ans 6: There are many advantages with JQuery. Some of them are :
- It is more like a JavaScript enhancement so there is no overhead in learning a new syntax.
- It has the ability to keep the code simple, readable, clear and reusable.
- It would eradicate the requirement for writing complex loops and DOM scripting library calls.
Ques 7. What does dollar Sign ($) means in JQuery?
Ans 7: Dollar Sign is nothing but it's an alias for JQuery. Take a look at below jQuery code
$(document).ready(function(){
});
Over here $ sign can be replaced with "jQuery " keyword.
jQuery(document).ready(function(){
});
Ques 8. What are the different type of selectors in Jquery?
Ans 8: There are 3 types of selectors in Jquery
1. CSS Selector
2. XPath Selector
3. Custom Selector
Ques 9. What is CDN?
Ans 9: CDN Stands for Content Distribution Network or also called Content Delivery Network is a group of computers placed at various points connected with network containing copies of data files to maximize bandwidth in accessing the data. In CDN a client access a copy of data nearer to the client location rather than all clients accessing
from the one particular server. This helps to achieve better performance of data retrieval by client.
There are two leading CDNs available that hosts jQuery files.
Microsoft - To load jQuery from Microsoft AJAX CDN
jQuery file can be loaded from Microsoft AJAX CDN. For more details, go to http://www.asp.net/ajaxlibrary/cdn.ashx. You will need to keep following tags in your page.
<script type="text/javascript" language="Javascript" src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.4.1.min.js"></script>
Google - To load jQuery from Google Libraries API
jQuery file can be loaded from Google CDN for more details, go to http://code.google.com/apis/libraries/devguide.html. You will need to keep following tag in your page.
<script type="text/javascript" language="Javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
Ques 10. Why to load jQuery file from CDN?
Ans 10 : You may ask that if we can load the jQuery file from our own server why to load it from the CDNs. The answer is logical and very simple. The browser behavior is that whenever it loads any webpage, it keeps related files (eg. Javascript file, CSS file and Images) used for that page into its cache (also called history). When next time the user browses any web page, browser loads only those files that are new or modified and is not available in the browser cache or history. In this way, browser improves its performance and loads the page.
The possibility is that if more and more websites are using CDNs, the user might have already browsed some other web pages that is using CDNs jQuery file and that file may have into browser cache; so when user browse your page and you are also using CDNs file, the older cached version of jQuery file will be used. In this way your page will load faster as browser will not have to load the jQuery file for your page again.
The benefit
1. Faster page load as jQuery file need not to be downloaded
2. Saves your bandwidth as jQuery file is not loaded from your server
3. Scalable - generally CDNs place these files on the servers located at different geographical locations of the world so that they load faster so irrespective of from where your user is browsing your page, your application runs well.
No comments:
Post a Comment