Learn - Today & Tomorrow!

1. Why so JavaScript and Java have similar name?A. JavaScript is a stripped-down version of JavaB. JavaScript's syntax is loosely based on Java'sC. They both originated on the island of JavaD. None of the aboveAns: B

2. When a user views a page containing a JavaScript program, which machine actually executes the script?A. The User's machine running a Web browserB. The Web serverC. A central machine deep within Netscape's corporate officesD. None of the aboveAns: A

5. What are variables used for in JavaScript Programs?A. Storing numbers, dates, or other valuesB. Varying randomlyC. Causing high-school algebra flashbacksD. None of the above Ans: A

6. _____ JavaScript statements embedded in an HTML page can respond to user events such as mouse-clicks, form input, and page navigation.A. Client-sideB. Server-sideC. LocalD. Native Ans: A

7. What should appear at the very end of your JavaScript?The <script LANGUAGE="JavaScript">tagA. The </script>B. The <script>C. The END statementD. None of the aboveAns: A

8. Which of the following can't be done with client-side JavaScript?A. Validating a formB. Sending a form's contents by emailC. Storing the form's contents to a database file on the serverD. None of the above Ans: C

9. Which of the following are capabilities of functions in JavaScript?A. Return a valueB. Accept parameters and Return a valueC. Accept parametersD. None of the above Ans: C

10. Which of the following is not a valid JavaScript variable name?A. 2namesB. _first_and_last_namesC. FirstAndLastD. None of the above Ans: A

11. ______ tag is an extension to HTML that can enclose any number of JavaScript statements.A. <SCRIPT>B. <BODY>C. <HEAD>D. <TITLE> Ans: A

12. How does JavaScript store dates in a date object?A. The number of milliseconds since January 1st, 1970B. The number of days since January 1st, 1900C. The number of seconds since Netscape's public stock offering.D. None of the above Ans: A

13. Which of the following attribute can hold the JavaScript version?A. LANGUAGEB. SCRIPTC. VERSIOND. None of the above Ans: A

15. Which of the following way can be used to indicate the LANGUAGE attribute?A. <LANGUAGE="JavaScriptVersion">B. <SCRIPT LANGUAGE="JavaScriptVersion">C. <SCRIPT LANGUAGE="JavaScriptVersion"> JavaScript statements…</SCRIPT>D. <SCRIPT LANGUAGE="JavaScriptVersion"!> JavaScript statements…</SCRIPT> Ans: C

17. What is the correct syntax for referring to an external script called " abc.js"?A. <script href=" abc.js">B. <script name=" abc.js">C. <script src=" abc.js">D. None of the above Ans: C

18. Which types of image maps can be used with JavaScript?A. Server-side image mapsB. Client-side image mapsC. Server-side image maps and Client-side image mapsD. None of the above Ans: B

19. Which of the following navigator object properties is the same in both Netscape and IE?A. navigator.appCodeNameB. navigator.appNameC. navigator.appVersionD. None of the above Ans: A

20. Which is the correct way to write a JavaScript array?A. var txt = new Array(1:"tim",2:"kim",3:"jim")B. var txt = new Array:1=("tim")2=("kim")3=("jim")C. var txt = new Array("tim","kim","jim")D. var txt = new Array="tim","kim","jim"Ans: C

21. What does the <noscript> tag do?A. Enclose text to be displayed by non-JavaScript browsers.B. Prevents scripts on the page from executing.C. Describes certain low-budget movies.D. None of the above Ans: A

22. If para1 is the DOM object for a paragraph, what is the correct syntax to change the text within the paragraph?A. "New Text"?B. para1.value="New Text";C. para1.firstChild.nodeValue= "New Text";D. para1.nodeValue="New Text";Ans: B

24. Which of the following best describes JavaScript?A. a low-level programming language.B. a scripting language precompiled in the browser.C. a compiled scripting language.D. an object-oriented scripting language. Ans: D

31. JavaScript is interpreted by _________A. ClientB. ServerC. ObjectD. None of the aboveAns: A

32. Using _______ statement is how you test for a specific condition.A. SelectB. IfC. SwitchD. For Ans: B

33. Which of the following is the structure of an if statement?A. if (conditional expression is true) thenexecute this codeend ifB. if (conditional expression is true)execute this codeend ifC. if (conditional expression is true) {then execute this code>->}D. if (conditional expression is true) then {execute this code}Ans: C

34. How to create a Date object in JavaScript?A. dateObjectName = new Date([parameters])B. dateObjectName.new Date([parameters])C. dateObjectName := new Date([parameters])D. dateObjectName Date([parameters]) Ans: A

36. To set up the window to capture all Click events, we use which of the following statement?A. window.captureEvents(Event.CLICK);B. window.handleEvents (Event.CLICK);C. window.routeEvents(Event.CLICK );D. window.raiseEvents(Event.CLICK ); Ans: A

44. A ________ object is a reference to one of the classes in a Java package, such as netscape.javascript .A. JavaArrayB. JavaClassC. JavaObjectD. JavaPackage Ans: B

45. The JavaScript exception is available to the Java code as an instance of __________A. netscape.javascript.JSObjectB. netscape.javascript.JSExceptionC. netscape.plugin.JSExceptionD. None of the aboveAns: B

46. To automatically open the console when a JavaScript error occurs which of the following is added to prefs.js?A. user_pref(" javascript.console.open_on_error", false);B. user_pref("javascript.console.open_error ", true);C. user_pref("javascript.console.open_error ", false);D. user_pref("javascript.console.open_on_error", true);Ans: D

47. To open a dialog box each time an error occurs, which of the following is added to prefs.js?A. user_pref("javascript.classic.error_alerts", true);B. user_pref("javascript.classic.error_alerts ", false);C. user_pref("javascript.console.open_on_error ", true);D. user_pref("javascript.console.open_on_error ", false); Ans: A

48. The syntax of a blur method in a button object is ______________A. Blur()B. Blur(contrast)C. Blur(value)D. Blur(depth) Ans: A

55. Which best explains getSelection()?A. Returns the VALUE of a selected OPTION.B. Returns document.URL of the window in focus.C. Returns the value of cursor-selected textD. Returns the VALUE of a checked radio input.Ans: C

Banner

Latest posts

What is a Design Pattern?
According to MSDN, "A design pattern is a description of a set of interacting classes that provide a framework for a solution to a generalized problem in a specific context or environment. In other words, a pattern suggests a solution to a particular problem or issue in object-oriented software development.”

In this article, I will discuss how we can create a Line, Rectangle, ellipse and Polygon control in WPF at design-time using XAML and at run-time using C#.I will also explain their properties to format such as fill property. After that, i will show you to set an image as the background of any shape object.

One question is always out there in most interviews. What is the difference between an Abstract Class and an Interface and why do you use one over the other? It seems like a simple question but most often, the answer to this question is not sufficient for the interviewer and can cost a job. So, I have decided to write an article about them and have tried to explain it.