1. Question: Which of the following could you do using JavaScript?

    A
    Form validation

    B
    Display a popup window

    C
    Verify usernames and passwords against the database

    D
    Database access

    E
    Change the color of the page

    F
    Display an alert

    G
    Prompt the user to enter a value

    Note: Not available
    1. Report
  2. Question: You have embedded the document.write() method to write some text within a pair of <TD></TD> table tags. Upon loading the file, however, you get some garbled junk on the page where that text should be. What could be the reason for this?

    A
    The browser does not support JavaScript

    B
    You are using an older version of the browser

    C
    The browser does not support cookies

    Note: Not available
    1. Report
  3. Question: After clicking on a link, your main browser window spawns a small new window and writes some text to it. However, when viewing both window page sources, the small window page source is identical to that of the large. How can this be?

    A
    The function writing to the new window didn't close the document stream

    B
    It cannot happen

    C
    Windows receive the source code of the window that wrote to them

    D
    Since the new window has no filename, it receives the source code of its parent

    Note: Not available
    1. Report
  4. Question: Choose another way to write x ? a = b : a = c

    A
    if ('x') { a = b; } else { a = c; }

    B
    if (x) { a = c; } else { a = b; }

    C
    x : a = c ? a = b

    D
    None of above

    Note: Not available
    1. Report
  5. Question: While coding a loop, you come across a condition where you have to terminate the loop and continue with the statements following the loop. Which statement would you use?

    A
    exit

    B
    return

    C
    continue

    D
    while

    E
    break

    Note: Not available
    1. Report
  6. Question: If an image is placed styled with z-index=-1 and a text paragraph is overlapped with it. Which one will be displayed on top?

    A
    The paragraph

    B
    The image

    C
    Could be any of the above

    Note: Not available
    1. Report
  7. Question: Given the statement var charConvert = toCharCode('x'), what is the error?

    A
    toCharCode() is a bogus method

    B
    Nothing. It will work fine

    C
    toCharCode accepts only numbers

    D
    toCharCode takes no arguments

    Note: Not available
    1. Report
  8. Question: Consider three variables: someText = 'JavaScript1.2'; pattern = /(\w+)(\d)\.(\d)/i; outCome = pattern.exec(someText); What does pattern.global contain?

    A
    true

    B
    false

    C
    undefined

    D
    null

    E
    0

    F
    1

    Note: Not available
    1. Report
  9. Question: The form tag is defined as follows: <form onsubmit="return Validate()" action="http://www.mysite.com/"> The validate() function is intended to prevent the form from being submitted if the name field in the form is empty. What will the validate() function look like?

    A
    <script type="text/JavaScript">
        function Validate()
        {
        if(document.forms[0].name.value == "")
                return true;
        else
            return false;
        }
        </script>

    B
    <script type="text/JavaScript">
        function Validate()
        {
        if(document.forms[0].name.value == "")
            return false;
        else
                return true;
        }
        </script>

    C
    <script type="text/JavaScript">
        function Validate()
        {
        if(document.forms[0].name== "")
                return false;
        else
                return true;
        }
        </script>

    D
    <script type="text/JavaScript">
        function Validate()
        {
        if(document.forms[0].name == "")
                return true;
        else
                return false;
        }
        </script>

    Note: Not available
    1. Report
  10. Question: You want to delete an element from an options array. How would you do it?

    A
    Set it to false

    B
    Set it to null

    C
    Set it to undefined

    D
    Set it to -1

    E
    Set it to 0

    F
    Set it to 1

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