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. |
Javascript code to get URL and Its different parts through code? |
|
Answer» JAVASCRIPT code to GET URL and Its different parts through code? Below is the code to get different part of URL in Javascript (1)window.location.protocol=This will return "http:" or "https:" (2)window.location.host=This will return rest part of url LIKE "crackyourinterview.com" (3)window.location.pathname=this will return the part after .com like "/MainAds-web.aspx" (4)window.location.search=this will return ?s=search text |
|
| 2. |
Replace all in Javascript with function to replace string? |
|
Answer» Replace all in Javascript with function to replace STRING? |
|
| 3. |
How to know user is a mobile or desktop user with the help Javascript Code? |
|
Answer» How to know user is a mobile or DESKTOP user with the HELP Javascript Code? |
|
| 4. |
Create a function without function name but having parameter in Javascript? |
|
Answer» Create a function WITHOUT function name but having PARAMETER in Javascript? |
|
| 5. |
Code to find last occurrence of any word in given sentance or string in Javascript? |
|
Answer» Code to FIND LAST occurrence of any word in given sentance or STRING in Javascript? |
|
| 6. |
selected radiobuttonlist value in javascript |
|
Answer» VAR objList = document.getElementById("radiobuttonid"); var RdlBoxCount = objList.getElementsByTagName("input"); for(var i = 0;i< RdlBoxCount.length;i++) { var RdlBoxRef = RdlBoxCount[i]; if (RdlBoxRef.checked == TRUE) { var labelArray = RdlBoxRef.parentNode.getElementsByTagName("label") var val = labelArray[i].innerHTML; alert(val) } } |
|
| 7. |
Create a Function in Javascript without function name with zero parameter? |
|
Answer» CREATE a Function in Javascript WITHOUT function name with ZERO parameter? Below is the code of javascript to create a function without the function name. Here we will create a variable with below given name:- var biggestval= function() But to get the OUTPUT we USE variable name with "();". And so we use biggestval(); Download Code
|
|
| 8. |
Reverse a Array in Javscript by using reverse keyword? |
|
Answer» Reverse a ARRAY in Javscript by USING reverse KEYWORD? |
|
| 9. |
Function to disable Back Button in javascript |
|
Answer» FUNCTION disableBackButton() { window.history.forward(); } SETTIMEOUT("disableBackButton()", 0); |
|