ExamVeda
Login
Home
51
What is the purpose of script loading?
Discuss
Answer & Solution
Answer: Option C
Solution:
The script loading loads remote JavaScript files programmatically and allows us to trick the rendering engine.
52
What will happen if the browser encounters a script tag without an src attribute?
Discuss
Answer & Solution
Answer: Option D
Solution:
If the browser encounters a script tag without a src attribute, the rendering engine simply passes the code to the JavaScript Interpreter for execution.
53
What is the solution to the absence of a script tag without an src attribute?
Discuss
Answer & Solution
Answer: Option B
Solution:
The solution to the absence of a script tag without an src attribute is to create inline JavaScript to append script tags to the document dynamically
54
How to get a particular value using the tagged name?
Discuss
Answer & Solution
Answer: Option C
Solution:
The method getElementsbyTagName() can be used to get a particular value using the tagged name associated with the document.
55
What should be the type of the script_url?
Discuss
Answer & Solution
Answer: Option D
Solution:
The type of the script_url can be anything that will be compared with the typeof keyword’s result.
56
What is the purpose of using the async attribute in the script tag?
Discuss
Answer & Solution
Answer: Option A
Solution:
The async option is a native attribute that will tell the browser to load the script asynchronously.
57
Why do we need to use an onload event in the script tag after using the async attribute?
Discuss
Answer & Solution
Answer: Option C
Solution:
When using async you don’t know when the file will be downloaded, so you can attach an onload event handler to the script tag. This will allow you to invoke or instantiate any code that will need to be run when the file is downloaded:
58
What is the purpose of the startTimeLogging() method?
Discuss
Answer & Solution
Answer: Option D
Solution:
The startTimeLogging() method captures the timing data for ad hoc, etc for referencing an uncached document.location.
59
What is the type of datatype the async attribute optionally accepts?
Discuss
Answer & Solution
Answer: Option C
Solution:
The async attribute optionally accepts the boolean datatype of default value as true.
60
What is the method used to create an element in the HTML DOM?
Discuss
Answer & Solution
Answer: Option B
Solution:
The createElement() can be used to create an element in the HTML DOM.