0

web technology Online Quiz - 88

Description: web technology Online Quiz - 88
Number of Questions: 20
Created by:
Tags: web technology
Attempted 0/20 Correct 0 Score 0

Which of the following is NOT a type of popup box.

  1. Alert

  2. Confirm

  3. Radio

  4. Text


Correct Option: C

The most common way to assign a value to a variable is by using what ?

  1. Equals sign

  2. Name It

  3. CSS

  4. HTML


Correct Option: A

AI Explanation

To answer this question, you need to understand how variables are assigned values in programming.

Option A) Equals sign - This option is correct. In most programming languages, the equals sign (=) is used to assign a value to a variable. For example, in Python, you can assign the value 5 to a variable named "x" by using the syntax "x = 5".

Option B) Name It - This option is incorrect. Naming a variable is important, but it is not the method used to assign a value to a variable.

Option C) CSS - This option is incorrect. CSS (Cascading Style Sheets) is a styling language used for web development and is not related to assigning values to variables.

Option D) HTML - This option is incorrect. HTML (Hypertext Markup Language) is a markup language used for creating web pages and is not related to assigning values to variables.

The correct answer is Option A) Equals sign. This option is correct because it is the most common way to assign a value to a variable in programming.

a++; is the same as which of the following ?

  1. a=a+2;

  2. a=a+3;

  3. a=a+1;

  4. a=a+4;


Correct Option: C

AI Explanation

To answer this question, we need to understand the post-increment operator (++).

The post-increment operator (++), when used after a variable, increments the value of the variable by 1 after the current expression is evaluated.

In this case, "a++" is the same as "a=a+1".

Let's go through each option to understand why it is correct or incorrect:

Option A) a=a+2; - This option is incorrect because it increments the value of 'a' by 2, not 1. Option B) a=a+3; - This option is incorrect because it increments the value of 'a' by 3, not 1. Option C) a=a+1; - This option is correct because it increments the value of 'a' by 1, which is the same as "a++". Option D) a=a+4; - This option is incorrect because it increments the value of 'a' by 4, not 1.

The correct answer is option C. This option is correct because "a++" is the same as "a=a+1".

To keep the browser from performing a script as soon as it is loaded you need to write the script as a what ?

  1. function

  2. delay

  3. performance

  4. Flexibility


Correct Option: A

Actions that can be detected by javascript are called ?

  1. HTML

  2. Events

  3. Array

  4. ArrayList


Correct Option: B

AI Explanation

To answer this question, you need to understand the concept of events in JavaScript.

Option A) HTML - This option is incorrect because HTML refers to the markup language used to structure the content of a webpage, and it is not directly related to detecting actions in JavaScript.

Option B) Events - This option is correct. Events in JavaScript are actions or occurrences that can be detected by JavaScript code. Examples of events include clicking a button, hovering over an element, or submitting a form.

Option C) Array - This option is incorrect. Arrays are a data structure in JavaScript used to store multiple values in a single variable. While arrays can be manipulated using JavaScript, they are not specifically related to detecting actions.

Option D) ArrayList - This option is incorrect. ArrayList is not a built-in JavaScript object or concept. It is a data structure in other programming languages such as Java, but it is not applicable in the context of JavaScript.

The correct answer is Option B) Events. This option is correct because events are the actions that can be detected by JavaScript.

A variable that your webpage can store on or retrieve from the users computer is known as ?

  1. Applet

  2. Java

  3. Cookie

  4. Session


Correct Option: C
  1. Not on windows platforms

  2. Yes

  3. No

  4. Not on Linux Platform


Correct Option: B

Which is detected when the mouse moves over a link ?

  1. overMouse event

  2. onMouseOver event

  3. onRollOver event

  4. OnMouseOut event


Correct Option: B

How do you read the first character in a string ?

  1. stringName.charAt(0);

  2. stringName.substring(1);

  3. stringName.charAt(1);

  4. stringName.charAt(2);


Correct Option: A

Which has no syntax error ?

  1. alert("hello "+3+" times);

  2. alert("hello "+3 times);

  3. alert("hello +3+ times");

  4. alert("hello "+3 +" times);


Correct Option: C

AI Explanation

To answer this question, we need to understand the syntax rules for JavaScript.

Option A) alert("hello "+3+" times); - This option has a syntax error. The closing parenthesis is missing at the end of the statement. The correct syntax should be alert("hello "+3+" times");.

Option B) alert("hello "+3 times); - This option also has a syntax error. The multiplication operator (*) is missing between the number 3 and the word "times". The correct syntax should be alert("hello "+3 * times); or alert("hello "+(3 * times)); depending on the value of the variable times.

Option C) alert("hello +3+ times"); - This option has no syntax error. It concatenates the string "hello ", the number 3, and the string " times" without any issues.

Option D) alert("hello "+3 +" times); - This option also has a syntax error. The closing parenthesis is missing at the end of the statement. The correct syntax should be alert("hello "+3 +" times");.

The correct answer is C. This option has no syntax error because it follows the correct syntax rules for concatenating strings and numbers in JavaScript.

Which method will open a new window ?

  1. popUp(PageURL,WindowName,settings);

  2. window.launch(PageURL,WindowName,settings);

  3. window.close(PageURL,WindowName,settings);

  4. window.open(PageURL,WindowName,settings);


Correct Option: D

Which method is used to search for a substring ?

  1. stringVariable.substring(subString)

  2. stringVariable.find(subString)

  3. stringVariable.indexOf(subString)

  4. stringVariable.indexOf(charAt(0))


Correct Option: C

AI Explanation

To answer this question, you need to understand the different methods used to search for a substring within a string.

Let's go through each option to understand why it is correct or incorrect:

Option A) stringVariable.substring(subString) - This option is incorrect because the substring method is used to extract a substring from a string based on the specified indices, not to search for a substring.

Option B) stringVariable.find(subString) - This option is incorrect because there is no find method in Java's String class. It might be a method available in a different programming language or library, but it is not applicable here.

Option C) stringVariable.indexOf(subString) - This option is correct. The indexOf method is used to search for the first occurrence of a substring within a string and returns the index of the substring if found. If the substring is not found, it returns -1.

Option D) stringVariable.indexOf(charAt(0)) - This option is incorrect because charAt(0) returns the first character of the string, not a substring. The indexOf method expects a substring as its parameter, not an individual character.

The correct answer is C) stringVariable.indexOf(subString). This option is correct because the indexOf method is used to search for a substring within a string.

Inside which HTML element do we put the JavaScript?


Correct Option: D

AI Explanation

To include JavaScript code in an HTML document, we use the `` element.

Let's go through each option to understand why it is correct or incorrect:

Option A) <scripting> - This option is incorrect because there is no HTML element called <scripting>. The correct element to include JavaScript is <script>.

Option B) <javascript> - This option is incorrect because there is no HTML element called <javascript>. The correct element to include JavaScript is <script>.

Option C) <js> - This option is incorrect because there is no HTML element called <js>. The correct element to include JavaScript is <script>.

Option D) <script> - This option is correct because we use the <script> element to include JavaScript code in an HTML document. This is the correct answer.

The correct answer is D) <script>.

What is the correct JavaScript syntax to write "Hello World"?

  1. Hello World"

  2. document.write("Hello World")

  3. response.write("Hello World")

  4. ("Hello World")


Correct Option: B

What is the correct syntax for referring to an external script called "xxx.js"?


Correct Option: C

which best describe void?

  1. method

  2. function

  3. statement

  4. operator


Correct Option: D

Which among the below are the best defences against XSS? Select 2 answers

  1. Use HTTPS only cookie

  2. Output Encoding

  3. Data Validation

  4. Use HTTPS protocol


Correct Option: B,C

does Maruti 800 has Differential

  1. yes

  2. no

  3. question is wrong

  4. may be


Correct Option: B

Who is inventor of c++

  1. RasmusLerdorf

  2. Dennis Ritchie

  3. Bjarne Stroutsup

  4. Dennis Mitchell


Correct Option: B

Which of the following statements regarding static testing is false:

  1. static testing requires the running of tests through the code

  2. static testing includes desk checking

  3. static testing includes techniques such as reviews and inspections

  4. static testing can give measurements such as cyclomatic complexity


Correct Option: A
- Hide questions