1.

What will happen if the browser encounters a script tag without an src attribute?(a) Throws an error(b) Throws an exception(c) Sends it to the compiler(d) Sends it to the interpreterThis question was addressed to me by my college director while I was bunking the class.Origin of the question is Script Loading topic in portion Invocation and Performance Navigation of JavaScript

Answer»

The correct CHOICE is (d) Sends it to the interpreter

The EXPLANATION: If the browser encounters a script tag without an src attribute, the rendering ENGINE SIMPLY PASSES the code to the JavaScript Interpreter for execution. The src attribute specifies the location (URL) of the external resource.



Discussion

No Comment Found

Related InterviewSolutions