UI Questions:
Notes:
a) This is not a test really but this entire document touches all the points that we must know and will help in great deal while debugging and developing screens.
b) Refer code for 1.html and 1.js for questions 2,3,4,8
c) Time duration 25 minutes
1) load method of xml DOM is used for
* to load xml file
* to load xml string
* there is no such method
* both xml file as well as xml string
code for 1.html
=========================================================
<html>
<head>
<script src="1.js" type="text/javascript">
<script>
function callMePlease(){
alert("gharwalaa");
}
</script>
</head>
<body>
<input type="text" id="one" name="first">
<input type="text" id="two" name="first">
<input type="radio" id="two" name="two"> Am I?
<select id="testSelect" name="textSelect">
<option value="1">one
<option value="2">two
<option value="3">three
</select>
<input type="button" id="two" name="mayBefirst" value="areYouConfused?"onclick="callMePlease()">
</body>
</html>
=========================================================
code for 1.js
function callMePlease(){
alert("baharwalaa");
}
2) document.getElementsByTagName("input").length = (how much?) < >
3) Write down all ways to access radio button
4) onclick of Button alerts shows -->
5) outerText,innerText,outerHTML are supported in IE only yes / no or don’t know ???
=========================================================
6) Can I have multiple forms in my body? why/why not?
=========================================================
7) default method in form submission
* post
* get
* must be specified
* repost ;)
=========================================================
8) fill in the blanks
* document.getElementById('testSelect')____________________ = two
* document.getElementById('testSelect')____________________ = 3
* Total length of the options --->
=========================================================
9)
alert(document.getElementsByTagName("select").length == document.getElementsByName("textSelect").length)
true /false???
10)
var aColors = ['red','blue','yellow']
alert(aColors.join().split(',').reverse()[0]) gives ___________
alert(aColors.join().split()[0] ) gives ___________
alert(aColors.join().split(',')[2]) gives ___________
alert(aColors.toString()) gives ___________
11) can function be passed as parameter to javascript function
1) yes
2) no
12) what’s wrong in the snippet below
<html>
<head>
<TITLE> UI Team Rocks !< /TITLE>
<script>
alert(document.getElementById('ketan').value)
</script>
</HEAD>
<body>
<input type="text" id="ketan" name="ketan" value="avid Trekker">
</body>
</html>
13) Overriding toString() method of function(any native object e.g. Array, Function etc) is possible through prototype modification ?
o yes
o no
14) Difference between onblur and onchange event?
15) ___________ this is the event for right-click
16) whats the “debugger” statement in javascript?
17) Can I have try inside my catch statement in try-catch block scenario?
18)How to refer topmost object in browser data model(BOM)?
o document
o top
o _top
o window
19) location.href refers to ______________________________
20) why do we include all js code as external files? (hint: its 5 letter word like ‘FCRUI’)
21) xmlhttpRequest response can be obtained in the following formats (single/multiple correct answers)
Hint : objXmlMLDom is xmlHttprequest object
o objXmlMLDom.responseXML
o objXmlMLDom.response
o objXmlMLDom.responseText
o objXmlMLDom.VS_RESPONSE<;)>
22)what event could be used to make autosuggest box for lets say GL account no? (single/multiple correct answers)
o onkeyDown
o onkeyUp
o onKeyPress
o either onblur or onchange
23) way to access CSS class of html element through DOM
o elem.class
o elem.style.class
o elem.className
o not possible; accesss elem.style and then change individual properties
24) Difference between div and span
25) true or false
NaN == NaN -->
null == undefined -->
false==0 -->
false===0 -->
"5"==5 -->
"5"===5 -->