.
Q23. Tell Me What Is Method Chaining In Jquery? What Is The Benefit Of Using Method Chaining?
Method chaining is calling another method on the result of another method, it results in clean and concise code, single search over DOM so better performance.
Q24. Explain Me Difference Between Javascript Window.onload Event And Jquery Ready Function?
This is the follow-up of the previous question. The main difference between the JavaScript onload event and the jQuery ready function is that the former not only waits for DOM to be created but also waits until all external resources are fully loaded including heavy images, audios and videos. If loading images and media content takes lot of time, then the user might experience significant delay on the execution of code defined in the window.onload event.
On the other hand, the jQuery ready() function only waits for the DOM tree, and does not wait for images or external resource loading, something that means faster execution. Another advantage of using the jQuery $(document).ready() is that you can use it at multiple times in your page, and the browser will execute them in the order they appear in the HTML page, as opposed to the onload technique, which can only be used for a single function. Given this benefits, it’s always better to use the jQuery ready() function rather than the JavaScript window.onload event.
Q25. Explain Me What Is The Difference In Caching Between Html5 And The Old Html?
An important feature of HTML5 is the Application Cache. It creates an offline version of a web application. and stores website files such as HTML files, CSS, images, and JavaScript, locally. It is a feature that speeds up site performance.
Q26. Explain Me What Is $(document).ready() Function? Why Should You Use It?
This is one of the most important and frequently asked questions. The ready() function is used to execute code when document is ready for manipulation. jQuery allows you to execute code, when DOM is fully loaded i.e. HTML has been parsed and the DOM tree has been constructed. The main benefit of $(document).ready() function is that, it works in all browser, jQuery handles cross browser difficulties for you. For curious reader see answer link for more detailed discussion.
Q27. Explain Me The Difference Between Cookies, Sessionstorage, And Localstorage?
Cookies are small text files that websites place in a browser for tracking or login purposes. Meanwhile, localStorage and sessionStorage are new objects, both of which are storage specifications but vary in scope and duration. Of the two, localStorage is permanent and website-specific whereas sessionStorage only lasts as long as the duration of the longest open tab.
Q28. Tell Us How Do You Optimize A Website’s Assets?
File concatenation, file compression, CDN Hosting, offloading assets, re-organizing and refining code, etc. Have a few ready.
Q29. Do You Know What Does Doctype Mean?
The term DOCTYPE tells the browser which type of HTML is used on a webpage. In turn, the browsers use DOCTYPE to determine how to render a page. Failing to use DOCTYPE or using a wrong DOCTYPE may load your page in Quirks Mode.
Q30. Explain Me What Is The Main Advantage Of Loading Jquery Library Using Cdn?
This is a slightly advanced jQuery question. Well, apart from many advantages including reducing server bandwidth and faster download, one of the most important is that, if browser has already downloaded same jQuery version from the same CDN, then it won’t download it again. Since nowadays, many public websites use jQuery for user interaction and animation, there is a very good chance that the browser already has the jQuery library downloaded.
Q31. Explain Me What Are Some New Input Attributes In Html5?
There are many new form elements including: datalist, datetime, output, keygen, date, month, week, time, number, range, email, and url.
Q32. Tell Me How Do You Hide An Image On A Button Click Using Jquery?
This jQuery interview question is based on event handling. jQuery provides good support for handling events like button click. You can use following code to hide an image, found using Id or class. What you need to know is the hide() method and how to setup an even handler for button, to handle clicks, you can use following jQuery code to do that :
$(‘#ButtonToClick’).click(function(){
$(‘#ImageToHide’).hide();
});
Q33. Tell Me How Do You Retrieve Attribute Of An Html Tag Using Jquery E.g. Href Of Links?
The attr() method is used to retrieve the value of an attribute of any HTML element. You first need to select all links or specified links using the jQuery selector and then you can apply the attr() method to get the value of their href attribute. The code below will find all links from a page and return the href value :
view sourceprint?
$(‘a’).each(function(){
alert($(this).attr(‘href’));
});
Q34. Explain Me What Is The Difference Between Html5 Interaction In Sencha And Twitter/bootstrap?
Sencha and Twitter/Bootstrap are both HTML development frameworks that integrate HTML5, CSS3, and JavaScript. The major difference is that in Sencha, the three languages are all comingled together in code, whereas in Bootstrap, HTML and CSS and decoupled.
Q35. Do You Know What Is The Difference Between Jquery.get() And Jquery.ajax() Method?
The ajax() method is more powerful and configurable, allows you to specify how long to wait and how to handle error. The get() method is a specialization to just retrieve some data.
Q36. Do You Know What Are Some New Html5 Markup Elements?
There are several:
,