1. Question: Consider the following variable declarations: Consider the following variable declarations: var a=" adam " var b=" eve " Which of the following would return the sentence " adam and eve "?

    A
    a.concatinate( "and ", b)

    B
    a.concat( "and ", b)

    C
    a.concatinate( " and ", b)

    D
    d. a.concat(" and ", b)

    Note: Not available
    1. Report
  2. Question: Which of the following code snippets is more efficient and why?
    <script language="JavaScript">
            for(i=0;i<document.images.length;i++)
                    document.images[i].src="blank.gif"; 
    </script> 
    
    <script language="JavaScript">
            var theimages = document.images;
            for(i=0;i<theimages.length;i++)
                    theimages[i].src="blank.gif"
    </script>

    A
    Both are equally efficient

    B
    The first code is more efficient as it contains less code

    C
    The first code is more efficient as it employs object caching

    D
    The second code is more efficient as it employs object caching

    Note: Not available
    1. Report
  3. Question: The following statements show two ways of calling a JavaScript function: i)onclick ="a();" ii)onclick="JavaScript:a();" Which of the following options is correct with regard to the above two statements?

    A
    There is no difference between the two statements

    B
    The first statement is incorrect and the second one is correct

    C
    The first statement is correct and the second statement is incorrect.

    Note: Not available
    1. Report
  4. Question: You have written the following function to change the source of an image at runtime: function changeimg(givenImg) { document.getElementById('imageID').src=givenImg } You would like the source of the image to change to "image2.gif" only for the time that the user clicks on the image. Which of the following will you use?

    A
    <img id="imageID" src="image1.gif" width="50" height="60" onmousedown="changeimg(image1.gif)" onmouseup="changeimg(image2.gif)">

    B
    <img id="imageID" src="image1.gif" width="50" height="60" onmouseclick="changeimg(image2.gif)" onmouseup="changeimg(image1.gif)">

    C
    <img id="imageID" src="image2.gif" width="50" height="60" onmousedown="changeimg(image1.gif)" onmouseup="changeimg(image2.gif)">

    D
    <img id="imageID" src="image1.gif" width="50" height="60" onmousedown="changeimg('image2.gif')" onmouseup="changeimg('image1.gif')">

    Note: Not available
    1. Report
  5. Question: Are the following two statements the same? object.property object[''property'']

    A
    Yes

    B
    No

    Note: Not available
    1. Report
  6. Question: Which of the following is not a JavaScript string method?

    A
    rep

    B
    split

    C
    substr

    D
    slice

    Note: Not available
    1. Report
  7. Question: Consider the following JavaScript alert:
    <script type="text/JavaScript">
    function message(){
      alert("Welcome to ExpertRating!!!")
    }
    </script>
    You want the user to see the above message upon opening the page. How will you implement this?

    A
    <body onload="message()">

    B
    <body onunload="message()">

    C
    <body onsubmit="message()">

    D
    <body onreset="message()">

    Note: Not available
    1. Report
  8. Question: You are setting cookies with JavaScript. What happens to cookies.txt data if the file exceeds the maximum size?

    A
    Your script automatically generates a run-time error

    B
    Your script automatically generates a load-time error

    C
    All processes using document.cookie are ignored

    D
    The file is truncated to the maximum length

    Note: Not available
    1. Report
  9. Question: What does the following code snippet do? <input type="radio" name="r1" value="radio1" onclick="this.checked=false;alert('sorry')">

    A
    The code is invalid

    B
    The code makes it necessary for the user to select the radio button

    C
    The code disables the radio button

    D
    The code displays an alert when the user selects the button

    Note: Not available
    1. Report
  10. Question: How would you declare a global variable in your JavaScript code?

    A
    All variables are local in JavaScript

    B
    You will have to declare the variable between the 'script' tags and outside a function to make the variable global

    C
    You will have to precede the variable name with the constant global

    D
    You will have to declare the variable in an external file

    Note: Not available
    1. Report
Copyright © 2024. Powered by Intellect Software Ltd