Saturday, December 12, 2009

JAVA SCRIPT

JAVA SCRIPT



1) Java script is an easy-to-use programming language that can be __________ in the header of web
a) Linked b) Embedded c) Insert d) All

2) Java Script was developed by ___________ under the name ____________
a) Microsoft, VBScript b) Sun, JavaScript
c) Sun, Live Script d) Netscape, Live Script

3) _________ was used as a communication medium between HTML documents & Java applets
a) Java Script b) Live Script c) Live Script d) ALL

4) In December, 1995, Netscape & Sun joined hands and renamed ________ as JavaScript
a) VBScript b) LiveScript c) JScript d) None

5). Java Script cannot be used in the following situations .
a) Designing web design to respond to user interaction b)Import & export data from database
c) Processing data on the client side before submitting it to the server. d)None.

6) Web page document is ______________.
a) An Object b) property c) Method d) None

7) To specify a particular elements of form we must use the forms property of ____object
a) Window b) Form c) Document d) none

8) Document.forms[2].button.value refers to value of button within the ________form of the current document.
a) second b) frist c) third d) None

9) __________ are used to describe an object or its current state.
a) Methods b) Properties c) events d) All

10)The background color of the document is set by a property
a) document.backcolor b) document.color c) document.bgcolor d) none

11)A function associated with an object is called object’s ________
a) Method b) Property c) event d) None


12) A new document is opened with the method
a) Document.url() b) document.load() c) document.open() d) none

13) _________ is the state that triggers a specific action on the object
a) Event b) Method c) Property d) None

14) __________ event will run the function when the user clicks on the button.
a) ondblclick b) onclick c) onfocus d) onblur

15) _________ are embedded in HTML tags, typically used as part of forms
a) Event b) Methods c) Event handlers d) none

16) Java Scripts can be inserted in to HTML pages between
a) Head tag b) Body tag c) both a & b d) None

17) _____________ attribute allows us to load javascript from a separate file on the server.
a) target b) src c)language d) none

18) File extension for src attribute value to locate JavaScript is ____________
a) .java b) .src c) .js d) none

19) We can point to script file using
a) Relative URL b) Absolute URL c) both a & b d) none

20) ___________ tags are used to hide comments in HTML from the browser
a) < ---------- > b) c) < ! ----- > d) none

21) Java Script variable names are
a) Not case sensitive b) Case Sensitive c) Some time case sensitive d) none

22). Variable name can contain
a) alphabets b) numbers c) underscores d) all of the above

23). ___________ is a valid variable name
a) _abc b) .abc c) ,abc d) none

24) (a) Global variable can be accessed from anywhere in the current script
(b) by other scripts in the same HTML page.
a) Both a & b
b) None

25) Variable declared inside a function _________ be accessed outside the function if they are preceded by a var keyword.
a) can b) cannot c) Access sometimes d) none

26) Which of the following is not primary datatype.
a) Boolean b) string c) null d) none

27) Number with leading ___________ are considered to be octal.
a) 8 b) oct c) 0 d) None

28) Which of the following is not a number.
a) 045 b) 0*45 c) 45 d) none

29). Numbers with ________ are considered as hexadecimal.
a) OX b) 0 c) 16 d) none

30). The concatenation of one int & one string is
a) string b) int c) Error d) None

31) ____________ returns the number of characters in the string.
a) Len b) Length c) char d) None

32). ______________ returns the character at the 5th position in MyString.
a) MyString.chatat(5) b) MyString.charAt(5)
c) MyString.charat(4) d) MyString.charAt(4)

33) To find index position of first occurrence o characters within the string
a) Stringname.indexOf() b) stringname.charAt()
c) stringname.first() d) none

34) _________ splits the string using the delimiter character passed.
a) split b) divide c) Both a & b d) none

35) __________ changes all string in the text to lowercase.
a) Lower() b) Lcase() c) toLowerCase() d) None

36) Substring() returns the substring at the specified _________ & ___________ index position .
a) top, bottom b) first, last c) start, end d) None

37) __________ makes text big by associating the tag.
a) big() b) small() c) large() d) expand()

38) _______ makes text blink by associating the tag.
a) blink() b) shine() c) expand() b) bright()

39). _____ makes text bold by associating the tag.
a) big() b) enlarge() c) bold() d) expand()

40). ___________ creates a hyperlink to the specified URL.
a) link d) anchor c) both d) none

41). ___________ creates a named anchor using the string.
a) link b) anchor c) both d) none

42). ___________ is used to convert a string to integer
a) toInteger() b) paraseInt() c) changeToInt() d) none

43). _____________ is used to convert a string to float
a) parseFloat() b) toFloat() c) both a & b d) none

44). From the following, which converts age(“16”) into number
a) parseInt(age) b) paraseInt.age c) age.parseInt() d) age.val()

45) We can convert a number to a string using javascript method called.
a) toText b) toString c) parseStrng d) none

46) c=11; d=c.toString(8), d contains _______ value.
a) 13 b) 013 c) “13” d) “013”

47) e=15; f=e.tostring(16); e contains
a) 0x0e b) “OxOe” c) “e” d) none

48). _____________ is used to insert a single quote into a string.
a) /’ b) \’ c) \\ d0 //’

49) ___________ is an object that is used to group related set of data together.
a) Function b) sub c) Array d) none

50). The index always begins at ________
a) zero b) 1 c) a & b d) none

51) _________ is used to execute a code segment a specific no of times
a) while b) for loop c) both a & b d) none

52) the value of x, after executing the following I=0
I=0
While(I++ <10)
{
x=i+2
}
a) 20 b) 22 c) 18 d) 44


53) ____________ statement allows us to terminate the loop.
a) continue b) Break c) both a & b d) none

54) __________ statement allows us to begin next iteration of a loop
a) continue b) break c) both a & b d) none

55) JavaScript supports __________ types of comments.
a) 1 b) 2 c) 3 d) 4

56). Single line comments in java script is _____
a) ^ b) // c) \\ d) \*

57) Double line comment in java script is ___________
a) /* /* b) \ * *\ c) *\ *\ d) / * */

58) using the window object, we cannot create
a) New Browser Window b) Alert Dialog c) Prompt Dialog d) None

59). _________ property of the window sets status message for the browser
a) Message b) alert c) status d) none

60). Alert dialog box contains _____________ buttons.
a) Ok & cancel b) Ok c) Cancel d) None

61) ________ event is executed when window is put to back
a) OnLoad b) OnUnload c) OnBlur d) OnFocus

62). ___________ event is executed when window is part at front
a) OnLoad b) OnUnload c) OnBlur d) OnFocus

63) _________ event is executed whenever a document finishes loading in to the window.
a) OnLoad b) OnEnter c) OnUnload d) none

64) The document object is defined when ____________ tag is evaluated in HTML page
a) Head b) Body c) Title d) script

65). The current location and URL is provided by _____________ object .
a) window b) document c) form d) frame

66). __________ tag is used to define the main body of the HTML
a) Head b) Main c) Body d) title

67) _________ attributes defines colors for text and links.
a) Head tag b) body tag c) title tag d) script tag

68). Properties of __________ object allows us to dynamically update colors and embedded object.
a) window b) Document c) form d) frame

69). _________ is the property of document that sets color for active links.
a) Alink b) color c) Linkcolor d) alinkcolor

70). __________ is the property of document that sets foreground color of text
a) forecolor b) textcolor c) foreground color d) fgcolor

71) ___________ sets color for visited links
a) vlink b) link color c) vlink color d) none

72) ____________ is used to store ID and preferences on the clients system can be set and checked.
a) Domain b) Cookies c) session d) none

73) ______________ clears the current page out of browser window
a) document.clear() b) window.clear() c) document.URL() d) none

74). __________ object loads a new document into the current window.
a) load() b) window c) document d) location

75) ___________ is used to reload the page in it’s initial state without update.
a) Location.replace() b) location.reload() c) both a & b d) None

76). _________ replaces the current history entry with the history of new page.
a) Location.replace() b) location.reload() c) both a & b d) none

77). The method of form object are ______________
a) submit b) reset c) both d) none

78). _________ is used by user to make more than one selection from a group of selections.
a) checkbox b) Radio Button c) Both d) None

79). If the radio button name is group1, we can work with first radio button using
a) document.formname.group1.first b) document.group1[0].name
c) document.group1[1].name d) document.formname.group1[0].name

80). __________ property of radio group returns true if object was checked by default.
a) checked b) default c) defaultchecked d) none

81) By adding ___________ key words to the member definitions, we allow multiple selections.
a) Selection b) Multiple c) both d) none

82) ________method causes the object to lose focus.
a) Blur() b) Focus c) Both d) none

83) __________ fields in a form are used to obtain input from users.
a) password b) text c) Both d) none

84) _____________ object is used whenever we want to work with timeevents.
a) time b) date c) documents d) none

85) ___________ object has useful properties and methods to perform calculations and generate random numbers.
a) random b) Arithmetic c) Math d) all the above

86). A function associated with an object is called as
a) property b) review c) method d) none









ANSWERS

1.b 16 c 31 b 46 b 61 c 76 a
2.d 17b 32 b 47 b 62 d 77 c
3.b 18 c 33 a 48 b 63 a 78 a
4b 19 a 34 a 49 c 64 b 79 b
5 d 20 c 35 c 50 a 65 b 80 b
6a 21b 36 c 51 c 66 c 81 b
7b 22 d 37 a 52 b 67 b 82 a
8c 23 a 38 a 53 c 68 b 83 c
9b 24 a 39 c 54 a 69 d 84 b
10 c 25 b 40 a 55 b 70 d 85 c
11 a 26 d 41 b 56 b 71 c 86 c
12 c 27 c 42 b 57 a 72 b
13 a 28 d 43 a 58 d 73 a
14 b 29 a 44 a 59 c 74 d
15 c 30 b 45 b 60 b 75d