1.

What will be done if more than one page requires a file of JavaScript code?(a) Downloads that many times(b) Retrives from the browser cache(c) Must be re executed(d) Must be included in all the pagesThis question was posed to me in an international level competition.This interesting question is from Embedding JavaScript in HTML topic in division Server-Side and Client-Side Scripting of JavaScript

Answer»

Right option is (b) Retrives from the browser cache

Explanation: If a file of JavaScript code is shared by more than one page, it only needs to be DOWNLOADED once, by the first page that uses it—subsequent PAGES can RETRIEVE it from the browser cache. This MAKES the LOADING process easier and hence faster.



Discussion

No Comment Found

Related InterviewSolutions