Category Archives: Jquery

Java Script Function To Return Selected Checkbox Value

Get the selected checkbox value from the group of checkbox list in Javascript. I wrote one function to return the selected checkbox value in Javascript. <script type=’text/javascript> // Java Script function to return the selected checkbox value function Checkbox_Selection_Value_From_Group (){ fileid= $(\”input[name=’filegroup[]’]:checked\”).map(function() { return this.value; }).get(); if(fileid==”){ alert(‘Select Minimum One Check Box’); return false; }else{ […]

Randomize an array in javascript

This is the sample post of randomize array concept in javascript; In the below example i will show you to randomize an array using its position in java script. var _arrayOne=[1,2,3,4,5,6,7]; var _arrayTwo=[27,26,24,23,29,28,25]; var _randArrayOne=[]; var _randArrayTwo=[]; function random(){ document.write(“Before Randomize”); document.write(‘\n’); document.write(_arrayOne); document.write(‘\n’); document.write(_arrayTwo); document.write(‘\n’); for(var i=0; i < 7; i++) { var _random […]

Redirect Page In Javascript

ASSIGN REDIRECT URL REDIECT TO GO BACK WINDOW NAVIGATION WINDOW LOCATION REPLACE I added the code to redirect the page using javascript ASSIGN REDIRECT URL <script language=”javascript” type=”text/javascript”> window.location.href=REDIRECTURL; //or window.location=REDIRECTURL; </script> REDIECT TO GO BACK <script language=”javascript”> alert(“Go Back”); window.history.back(-1); </script> WINDOW NAVIGATION <script language=”javascript”> window.navigate(REDIRECTURL); </script> WINDOW LOCATION REPLACE <script language=”javascript”> window.location.replace(REDIRECTURL); </script>

Url Parsing In Jquery

Get Url(domain) parameter using jquery function. In below code, I wrote one function called¬†getUrlVars(). Using this function you can get requesting parameter value. If parameter not found., It will return undefined response It was working for me good. var ID= getUrlVars()[“id”]; if(ID==undefined){ ID=”; } function getUrlVars() { var vars = {}; var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, […]