Correct Answer: Nojava and javascript are two different languages Java is a powerful object - oriented programming language like C++,C whereas Javascript is a client-side scripting language with some limitations
Correct Answer: Generation of HTML pages on-the-fly without accessing the Web server The user can be given control over the browser like User input validation Simple computations can be performed on the client's machine The user's browser, OS, screen size, etc can be detected Date and Time Handling
4. Where are cookies actually stored on the hard disk?
Correct Answer: This depends on the user's browser and OS In the case of Netscape with Windows OS,all the cookies are stored in a single file called cookiestxt c:\Program Files\Netscape\Users\username\cookiestxt In the case of IE,each cookie is stored in a separate file namely username@websitetxt c:\Windows\Cookies\username@Websitetxt
Correct Answer: No JavaScript does not have block level scope, all the variables declared inside a function possess the same level of scope unlike c,c++,java
Correct Answer: jQuery is a quick as well as concise JavaScript Library that simplifies HTML document traversing, animating, event handling, & Ajax interactions for the purpose of quick web development needs So although they are not entirely different, both are not the same either!
10. How JavaScript timers work? What is a drawback of JavaScript timers?
Correct Answer: Timers allow you to execute code at a set time or repeatedly using an interval This is accomplished with the setTimeout, setInterval, and clearInterval functions The setTimeout(function, delay) function initiates a timer that calls a specific function after the delay; it returns an id value that can be used to access it later The setInterval(function, delay) function is similar to the setTimeout function except that it executes repeatedly on the delay and only stops when cancelled The clearInterval(id) function is used to stop a timer Timers can be tricky to use since they operate within a single thread, thus events queue up waiting to execute