InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Discuss The Relationship Between Javascript And Ecmascript? |
|
Answer» Javascript is a SCRIPTING language that has been widely accepted for CLIENT side web development. However it ORIGINATED from ECMA standards. ECMA and livescripts are just other names of java SCRIPT. Javascript is a scripting language that has been widely accepted for client side web development. However it originated from ECMA standards. ECMA and livescripts are just other names of java script. |
|
| 2. |
How To Read And Write A File Using Java Script? |
|
Answer» This can be done in TWO ways which are discussed below, This can be done in two ways which are discussed below, |
|
| 3. |
What Are Windows Object And Navigator Object In Javascript? |
|
Answer» The top level object in java SCRIPT is the windows object. It further has several other objects such as document, LOCATION, history, menu bar, name, ETC. contained WITHIN itself. The global object on which client side java scripts are written is the windows object. Information regarding the client SYSTEM is returned by the Navigator browser of the script. For all users Navigator browsers are the base object. The top level object in java script is the windows object. It further has several other objects such as document, location, history, menu bar, name, etc. contained within itself. The global object on which client side java scripts are written is the windows object. Information regarding the client system is returned by the Navigator browser of the script. For all users Navigator browsers are the base object. |
|
| 4. |
What Is Decodeuri(), Encodeuri() In Javascript? |
|
Answer» In order to transform the URL into its hexadecimal equivalent the encodeURI() and decodeURI() are used. This is done to send the CHARACTERS that by DEFAULT cannot be SPECIFIED in a URL. For example, the following code snippet PERFORMS the encoding of URL: In order to transform the URL into its hexadecimal equivalent the encodeURI() and decodeURI() are used. This is done to send the characters that by default cannot be specified in a URL. For example, the following code snippet performs the encoding of URL: |
|
| 5. |
Discuss How Can We Access Elements Using Java Script? |
|
Answer» Each elements of JavaScript can be ACCESSED by their names. To access the page, document element is used and to access the BROWSER the windowelement is used in the SCRIPT. This element’s values are required for several computing reason say validation check. For EXAMPLE: Each elements of JavaScript can be accessed by their names. To access the page, document element is used and to access the browser the windowelement is used in the script. This element’s values are required for several computing reason say validation check. For example: |
|
| 6. |
How Do We Get Javascript Onto A Web Page? |
|
Answer» The script ELEMENT can directly be added INSIDE the body of the PAGE. It should START with the TAG <script> and end with </script> tag. The script can also be added to the head tag of the web page. Similarly the other way is by placing the script in a separate file which gets downloaded on the client’s machine when the page is requested. The script element can directly be added inside the body of the page. It should start with the tag <script> and end with </script> tag. The script can also be added to the head tag of the web page. Similarly the other way is by placing the script in a separate file which gets downloaded on the client’s machine when the page is requested. |
|
| 7. |
What Does Sticky Session Mean In A Web-farm Scenario? |
|
Answer» Sticky session is a characteristic which provides LOAD balancing solution for web farms for re-routing the request of the session to the machine which FIRST answered the request for that session. This ensures the session persistency in CASE when the session is ROUTED to other servers. Sticky session causes UNEVEN load distribution across servers. Sticky session is a characteristic which provides load balancing solution for web farms for re-routing the request of the session to the machine which first answered the request for that session. This ensures the session persistency in case when the session is routed to other servers. Sticky session causes uneven load distribution across servers. |
|
| 8. |
How Can Javascript Make A Web Site Easier To Use? |
|
Answer» Javascripts RUN on the client side which saves the server roundtrip time for SMALL processing. It means that it makes web pages more interactive as everything is not REQUIRED to be submitted at the server. Let’s consider a small clock if CONTROLLED by the server then the transmission time will make the clock faulty in this case javascript is used. Javascripts run on the client side which saves the server roundtrip time for small processing. It means that it makes web pages more interactive as everything is not required to be submitted at the server. Let’s consider a small clock if controlled by the server then the transmission time will make the clock faulty in this case javascript is used. |
|
| 9. |
What Are The Methods Of Validating Whether The Form Is Secure? |
|
Answer» Security of a form can be ensured by several ways some of them are:- Security of a form can be ensured by several ways some of them are:- |
|
| 10. |
What Is The Main Difference Between Client Side Javascript And Server Side Java Script? How Actually They Run On Both Side? |
|
Answer» To state the main DIFFERENCE, JavaScript at the CLIENT SIDE does not require a web server to make it run instead it uses the client’s processor for this purpose. This eradicates the portability issue. But in server side JavaScript deployment, portability, configuration are major and vast issues and requires a web server to run the SCRIPT within a page before rendering its output as a response html page. To state the main difference, JavaScript at the client side does not require a web server to make it run instead it uses the client’s processor for this purpose. This eradicates the portability issue. But in server side JavaScript deployment, portability, configuration are major and vast issues and requires a web server to run the script within a page before rendering its output as a response html page. |
|
| 11. |
What Is Java Script And What Are Their Functionalities? |
|
Answer» JavaScript is a CLIENT side scripting language that is mainly used to PERFORM client side processing to prevent server round trips and to make the USER response time faster. It is widely used for validation purpose such as confirm password validation and etc. It is GENERALLY embedded WITHIN the HTML which on client side is interpreted by the browser and the scripts are copy able. JavaScript is a client side scripting language that is mainly used to perform client side processing to prevent server round trips and to make the user response time faster. It is widely used for validation purpose such as confirm password validation and etc. It is generally embedded within the HTML which on client side is interpreted by the browser and the scripts are copy able. |
|
| 12. |
What Is The Difference Between Javascript And Jscript? |
|
Answer» Jscript supports more rich set of functionality/commands than the java script, through which ActiveX and LOCAL COMPUTER can be accessed. These commands are used in an intranet where the connecting computer’s configuration is known and they are all being accessed USING INTERNET Explorer. While java script targets unknown machine configuration and Jscript cannot for which java script are suitable for internet which Jscripts are not. Jscript supports more rich set of functionality/commands than the java script, through which ActiveX and local computer can be accessed. These commands are used in an intranet where the connecting computer’s configuration is known and they are all being accessed using Internet Explorer. While java script targets unknown machine configuration and Jscript cannot for which java script are suitable for internet which Jscripts are not. |
|
| 13. |
Decodeuri(), Encodeuri() |
|
Answer» Many CHARACTERS cannot be sent in a URL, but must be converted to their hex encoding. These functions are used to convert an entire URI (a superset of URL) to and from a format that can be sent VIA a URI. Many characters cannot be sent in a URL, but must be converted to their hex encoding. These functions are used to convert an entire URI (a superset of URL) to and from a format that can be sent via a URI. |
|
| 14. |
Unescape(), Escape() |
|
Answer» These are similar to the decodeURI() and encodeURI(), but escape() is used for only PORTIONS of a URI. These are similar to the decodeURI() and encodeURI(), but escape() is used for only portions of a URI. |
|
| 15. |
What's Prototypes For Javascript? |
|
Answer» Objects have "prototypes" from which they may INHERIT fields and functions. Objects have "prototypes" from which they may inherit fields and functions. |
|
| 16. |
How To Use "join()" To Create A String From An Array Using Javascript? |
|
Answer» "join" concatenates the ARRAY elements with a SPECIFIED seperator between them. "join" concatenates the array elements with a specified seperator between them. |
|
| 17. |
How To Use Strings As Array Indexes Using Javascript? |
|
Answer» Javascript does not have a true hashtable object, but through its wierdness, you can USE the ARRAY as a hashtable. Javascript does not have a true hashtable object, but through its wierdness, you can use the array as a hashtable. |
|
| 18. |
How To Delete An Entry Using Javascript? |
|
Answer» The "delete" operator removes an array element, but oddly does not CHANGE the size of the array. The "delete" operator removes an array element, but oddly does not change the size of the array. |
|
| 19. |
What Does The Delete Operator Do? |
|
Answer» The delete operator is used to delete all the variables and objects used in the PROGRAM ,but it does not delete variables DECLARED with var keyword. The delete operator is used to delete all the variables and objects used in the program ,but it does not delete variables declared with var keyword. |
|
| 20. |
What's The Date Object Using Javascript? |
|
Answer» Time inside a date object is stored as MILLISECONDS since Jan 1, 1970. Time inside a date object is stored as milliseconds since Jan 1, 1970. |
|
| 21. |
What's Math Constants And Functions Using Javascript? |
|
Answer» The Math object contains useful CONSTANTS such as Math.PI, Math.E The Math object contains useful constants such as Math.PI, Math.E |
|
| 22. |
How To Test For Bad Numbers Using Javascript? |
|
Answer» the global method, "isNaN()" can TELL if a number has GONE bad. the global method, "isNaN()" can tell if a number has gone bad. |
|
| 23. |
How To Convert Numbers To Strings Using Javascript? |
|
Answer» You can prepend the number with an EMPTY string You can prepend the number with an empty string |
|
| 24. |
How To Convert A String To A Number Using Javascript? |
|
Answer» You can use the parseInt() and parseFloat() methods. NOTICE that extra letters following a valid number are ignored, which is kinda wierd but convenient at times. You can use the parseInt() and parseFloat() methods. Notice that extra letters following a valid number are ignored, which is kinda wierd but convenient at times. |
|
| 25. |
How To Force A Page To Go To Another Page Using Javascript? |
|
Answer» <script LANGUAGE="JAVASCRIPT" TYPE="text/javascript" ><!-- location.href= "HTTP://newhost /newpath /newfile.html"; //--></script> <script language="JavaScript" type="text/javascript" ><!-- location.href= "http://newhost /newpath /newfile.html"; //--></script> |
|
| 26. |
How To Reload The Current Page |
|
Answer» window.location.reload(TRUE); window.location.reload(true); |
|
| 27. |
How To Set The Cursor To Wait. |
|
Answer» In THEORY, we should cache the current state of the CURSOR and then put it back to its original state. In theory, we should cache the current state of the cursor and then put it back to its original state. |
|
| 28. |
How To Make Elements Invisible |
|
Answer» Change the "visibility" ATTRIBUTE of the style OBJECT associated with your element. REMEMBER that a hidden element still takes up space, use "DISPLAY" to MAKE the space disappear as well. Change the "visibility" attribute of the style object associated with your element. Remember that a hidden element still takes up space, use "display" to make the space disappear as well. |
|
| 29. |
How To Change Style On An Element? |
|
Answer» Between CSS and javascript is a WEIRD symmetry. CSS STYLE rules are layed on TOP of the DOM. The CSS property names like "font-weight" are transliterated into "myElement.style.fontWeight". The class of an ELEMENT can be swapped out. For example: Between CSS and javascript is a weird symmetry. CSS style rules are layed on top of the DOM. The CSS property names like "font-weight" are transliterated into "myElement.style.fontWeight". The class of an element can be swapped out. For example: |
|
| 30. |
How To Getting Values From Cookies To Set Widgets? |
|
Answer» function getCookieData(labelName) { function getCookieData(labelName) { |
|
| 31. |
How To Setting A Cookie With The Contents Of A Textbox ? |
|
Answer» Values stored in cookies may not have semicolons, commas, or spaces. You should use the handy "escape()" function to encode the values, and "unescape()" to retrieve them. Values stored in cookies may not have semicolons, commas, or spaces. You should use the handy "escape()" function to encode the values, and "unescape()" to retrieve them. |
|
| 32. |
How To Open A Window With No Toolbar, But With The Location Object. |
|
Answer» window.open("HTTP://www.mysite.org/Misc/PENNIES","Pennies","resizable=yes, status=yes,toolbar=yes,location=yes,menubar=yes,scrollbars=yes,width=800,height=400"); window.open("http://www.mysite.org/Misc/Pennies","Pennies","resizable=yes, status=yes,toolbar=yes,location=yes,menubar=yes,scrollbars=yes,width=800,height=400"); |
|
| 33. |
How To Create An Input Box? |
|
Answer» PROMPT("What is your TEMPERATURE?"); prompt("What is your temperature?"); |
|
| 34. |
How To Create A Confirmation Box? |
|
Answer» CONFIRM("Do you REALLY WANT to LAUNCH the MISSILE?"); confirm("Do you really want to launch the missile?"); |
|
| 35. |
How To Create A Popup Warning Box |
|
Answer» ALERT('Warning: Please ENTER an INTEGER between 0 and 100.'); alert('Warning: Please enter an integer between 0 and 100.'); |
|
| 36. |
How To Have The Status Line Update When The Mouse Goes Over A Link (the Support Of The Status Line Is Sporadic)? |
|
Answer» <a href="javascript.shtml" <a href="javascript.shtml" |
|
| 37. |
How To Have An Element Invoke A Javascript On Selection, Instead Of Going To A New Url: |
|
Answer» <script type="text/JAVASCRIPT"> <script type="text/javascript"> |
|
| 38. |
How To Add New Elements Dynamically. |
|
Answer» <html xmlns="http://www.w3.org/1999/xhtml" xml:LANG="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
|
| 39. |
To Write Messages To The Screen Without Using "document.write()" ? |
|
Answer» CHANGING the contents of an element is a much better solution. When the method showStatus is invoked it will CHANGE the CONTENT of the span. Changing the contents of an element is a much better solution. When the method showStatus is invoked it will change the content of the span. |
|
| 40. |
How To Disable An Html Object |
|
Answer» document.getElementById("myObject").DISABLED = TRUE; document.getElementById("myObject").disabled = true; |
|
| 41. |
How To Find Radio Button Selection When A Form Is Submitted? |
|
Answer» <SCRIPT type="text/javascript"> <script type="text/javascript"> |
|
| 42. |
How To Find The Selected Radio Button Immediately Using The 'this' Variable? |
|
Answer» <script> <script> |
|
| 43. |
What Is === Operator ? |
|
Answer» ==== is STRICT equality operator ,it returns TRUE only when the TWO operands are having the same value without any type conversion. ==== is strict equality operator ,it returns true only when the two operands are having the same value without any type conversion. |
|
| 44. |
What Are Undefined And Undeclared Variables? |
|
Answer» Undeclared variables are those that are not declared in the program (do not exist at all),TRYING to read their values gives runtime error.But if undeclared variables are assigned then IMPLICIT DECLARATION is done . Undefined variables are those that are not assigned any value but are declared in the program.Trying to read such variables gives SPECIAL value CALLED undefined value. Undeclared variables are those that are not declared in the program (do not exist at all),trying to read their values gives runtime error.But if undeclared variables are assigned then implicit declaration is done . Undefined variables are those that are not assigned any value but are declared in the program.Trying to read such variables gives special value called undefined value. |
|
| 45. |
Does Javascript Have The Concept Level Scope? |
|
Answer» No.Javascript does not have block LEVEL scope,all the variables DECLARED INSIDE a function possess the same level of scope unlike C,c++,java. No.Javascript does not have block level scope,all the variables declared inside a function possess the same level of scope unlike c,c++,java. |
|
| 46. |
What Is Variable Typing In Javascript? |
|
Answer» It is perfectly legal to ASSIGN a number to a variable and then assign a STRING to the same variable as follows It is perfectly legal to assign a number to a variable and then assign a string to the same variable as follows |
|
| 47. |
What Is The Difference Between Undefined Value And Null Value? |
|
Answer» (i)UNDEFINED VALUE cannot be explicitly STATED that is there is no keyword called undefined whereas null value has keyword called null (i)Undefined value cannot be explicitly stated that is there is no keyword called undefined whereas null value has keyword called null |
|
| 48. |
What Does Undefined Value Mean In Javascript? |
|
Answer» Undefined value MEANS the VARIABLE used in the CODE DOESNT exist or is not assigned any value or the PROPERTY doesnt exist. Undefined value means the variable used in the code doesnt exist or is not assigned any value or the property doesnt exist. |
|
| 49. |
How To Select An Element By Id And Swapping An Image ? |
|
Answer» <script language="JavaScript" type="text/javascript" > <script language="JavaScript" type="text/javascript" > |
|
| 50. |
To Set All Checkboxes To True Using Javascript? |
|
Answer» //SELECT all input TAGS //select all input tags |
|