Author: Arjun

How to add reference in c#

{0 Comments}

How to add reference in c#

Visual Studio There is a dialog box named Add reference, this is basically used to add a reference or to delete a reference. And this is available under project menu. Following is the steps to add reference in c#. 1)      Firstly, select project from the solution explorer. 2)      From the project menu, select Add reference. …

Read More…

What are the limitations of cookies?

{0 Comments}

This article contains the list of limitation which cookies do have. One of them is the limitation of domain it limited to one domain only. And only 20 cookies are allowed per domain. That really means cookies can only be read from the page of its own domain. Other limitation of the cookies is the …

Read More…

How to delete cookies in JavaScript

{0 Comments}

To delete cookies of a browser using JavaScript there are many ways which developer uses. Setting past date for expiry  One of popular practice is to overwrite the cookies expiration time and then set it some date that which have passed. So it will get removed after setting the session value to expired date. This …

Read More…

How to write cookies in JavaScript

{0 Comments}

Writing or setting the cookies using JavaScript is simple. You need use document.cookies command then after equal sign write cookies name and then cookies value after an equal operator as shown in the following code snippets  Javascript |  copy code |? 1Document.cookies=cookiesname=cookiesvalue;

Read More…

How to read cookies in JavaScript

{0 Comments}

To read cookies in a JavaScript following is the JavaScript function which will help you to read the particular cookies with the name which you have supplied in the function   Javascript |  copy code |? 01<script>02 03function readCookie(name) {04 05 var cookiename = name + "=";06 07 var ca = document.cookie.split(’;');08 09 for(var i=0;i < ca.length;i++)10 {11 12 var c = ca[i];13 14 while (c.charAt(0)==’ ‘) …

Read More…

Javascript code for alphanumeric validation

{0 Comments}

Following is the code for the alphanumeric validation in JavaScript   Javascript |  copy code |? 01<script type="text/javascript">02function alphanumeric(abc)03{04 var numaric = abc;05 for(var j=0; j<numaric.length; j++)06 {07 var alphaa = numaric.charAt(j);08 var hh = alphaa.charCodeAt(0);09 if((hh > 47 && hh<58) || (hh > 64 && hh<91) || (hh > 96 && hh<123))10 {11 }12 else {13 alert("value entered is not …

Read More…

How to find div height in JavaScript

{0 Comments}

To get the height of div in JavaScript following is the powerful JavaScript function I found on Google which is giving the result. So you can get the height of the div by using following function.    Javascript |  copy code |? 01function GetHeight() {02 var oDiv = document.getElementById("MyDiv");03 var sOriginalOverflow = oDiv.style.overflow;04 var sOriginalHeight = oDiv.style.height;05 oDiv.style.overflow = "";06 oDiv.style.height …

Read More…

How to find checkbox is checked in JavaScript

{0 Comments}

To find if checkbox is checked or not then you can use checked term with checkbox id can be use to get Boolean value the “true”,”false”. In following code sample there is a variable which get the Boolean value according the status of checkbox. So you can use following code sample to check if checkbox …

Read More…

How to find current URL in JavaScript

{0 Comments}

If you need to get url of the same page loading in JavaScript then document.URL will help you, this will return the only the current URL as implemented in following code snippets  Javascript |  copy code |? 1var text=document.URL;2 document.write(text);3 If above code is not helping you then you can use following code snippet. In which Window.location.href because I found …

Read More…