| 1. |
Explain Caching In Jquery? |
|
Answer» Caching is TEMPORARY MEMORY to store the data, which increases the performance of the application. So in JQUERY we can use the similar concept to store the data instead of repeating as shown below: Old Code: $('#MyControlID').addClass('test'); $('#MyControlID').css('color', 'yellow'); New Code for caching: var $mycontrol = $("#MyControlID").css("color", "red"); //Do somre STUFFS here $mycontrol.text("Error occurred!"); Caching is temporary memory to store the data, which increases the performance of the application. So in Jquery we can use the similar concept to store the data instead of repeating as shown below: Old Code: $('#MyControlID').addClass('test'); $('#MyControlID').css('color', 'yellow'); New Code for caching: var $mycontrol = $("#MyControlID").css("color", "red"); //Do somre stuffs here $mycontrol.text("Error occurred!"); |
|