<< < 1 2 3 4 5 >   Sort: Date

What is variable typing in JavaScript?
What is variable typing in JavaScript? It is perfectly legal to assign a number to a variable and then assign a string to the same variable as in the following example: i = 10; i = "string"; This is called variable typing
2008-11-25, 4369👍, 0💬

You have an ASP.NET web application running on a web-farm ...
You have an ASP.NET web application running on a web-farm that does not use sticky sessions - so the requests for a session are not guaranteed to be served the same machine. Occasionally, the users get error message Validation of viewstate MAC failed. What could be one reason that is causing this er...
2008-11-11, 4364👍, 0💬

How to set the cursor to wait?
How to set the cursor to wait? In theory, we should cache the current state of the cursor and then put it back to its original state. document.body.style.cursor = 'wait'; //do something interesting and time consuming document.body.style.cursor = 'auto';
2009-02-10, 4338👍, 0💬

How to hide JavaScript code from old browsers that does not support JavaScript?
How to hide JavaScript code from old browsers that does not support JavaScript? Use the below specified style of comments: &lt;script language=javascript> &lt;!-- javascript code goes here // --&gt; &lt;/script> or Use the &lt;NOSCRIPT> and &lt;/NOSCRIPT> tags and code the di...
2008-10-07, 4335👍, 0💬

How to create an input box?
How to create an input box? prompt("What is your temperature?");
2009-01-13, 4328👍, 0💬

What's the Date object using JavaScript?
What's the Date object using JavaScript? Time inside a date object is stored as milliseconds since Jan 1, 1970. new Date(06,01,02) // produces "Fri Feb 02 1906 00:00:00 GMT-0600 (Central Standard Time)" new Date(06,01,02).toLocaleString( )// produces "Friday, February 02, 1906 00:00:00" new Date(06,...
2009-03-03, 4314👍, 0💬

How to comment JavaScript code?
How to comment JavaScript code? Use // for line comments and /* */ for block comments
2008-10-14, 4295👍, 0💬

What are undefined and undeclared variables?
What are undefined and undeclared variables? 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...
2008-12-02, 4292👍, 0💬

How to have the status line update when the mouse goes over a link?
How to have the status line update when the mouse goes over a link? &lt;a href="javascript.shtml" onmouseover="window.status='Hi There!';return true" onmouseout="window.status='';r eturntrue">Look at the Status bar&lt;/a> Look at the Status bar as your cursor goes over the link.
2008-12-30, 4277👍, 0💬

What is === operator?
What is === operator? ==== is strict equality operator, it returns true only when the two operands are having the same value without any type conversion.
2008-12-09, 4274👍, 0💬

How to create a confirmation box?
How to create a confirmation box? confirm("Do you really want to launch the missile?");
2009-01-06, 4268👍, 0💬

How to convert a string to a number using JavaScript?
How to convert a string to a number using JavaScript? 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. parseInt("100") ==&gt; 100 parseFloat("98.6") ==&gt; 98.6 parseFloat("98.6 ...
2009-02-17, 4257👍, 0💬

How to test for bad numbers using JavaScript?
How to test for bad numbers using JavaScript? The global method, "isNaN()" can tell if a number has gone bad. var temperature = parseFloat(myTemperatureWidget .value);if(!isNaN(temperature)) { alert("Please enter a valid temperature."); }
2009-02-25, 4251👍, 0💬

What is the difference between undefined value and null value?
What is the difference between undefined value and null value? Undefined value cannot be explicitly stated that is there is no keyword called undefined whereas null value has keyword called null. typeof undefined variable or property returns undefined whereas typeof null value returns object
2008-11-25, 4216👍, 0💬

How to add new elements dynamically.
How to add new elements dynamically. &lt;html xmlns="http://www.w3.org/1999/ xhtml"xml:lang="en" lang="en"> &lt;head> &lt;title>t1&lt;/title >&lt;script type="text/javascript"> function addNode() { var newP = document.createElement("p"); var textNode = document.createTextNode(" I...
2008-12-23, 4210👍, 0💬

What is JavaScript?
What is JavaScript? JavaScript is a platform-independent, event-driven, interpreted client-side scripting and programming language developed by Netscape Communications Corp. and Sun Microsystems. JavaScript is a general-purpose programming language designed to let programmers of all skill levels con...
2010-05-11, 4209👍, 0💬

Does JavaScript have the concept level scope?
Does JavaScript have the concept level scope? No. JavaScript does not have block level scope, all the variables declared inside a function possess the same level of scope unlike c, c++, and java.
2008-12-02, 4209👍, 0💬

How to find radio button selection when a form is submitted?
How to find radio button selection when a form is submitted? &lt;script type="text/javascript"> function findButton() { var myForm = document.forms.animalForm; var i; for (i=0;i&lt;myForm.marsupial .length;i++) { if (myForm.marsupial[i].checked) { break; } } alert("You selected \""+myForm.ma...
2008-12-16, 4200👍, 0💬

Name the numeric constants representing max, min values
Name the numeric constants representing max, min values Number.MAX_VALUE Number.MIN_VALUE
2008-10-14, 4188👍, 0💬

How to convert numbers to strings using JavaScript?
How to convert numbers to strings using JavaScript? You can prepend the number with an empty string var mystring = ""+myinteger; or var mystring = myinteger.toString(); You can specify a base for the conversion, var myinteger = 14; var mystring = myinteger.toString(16); mystring will be "e".
2009-02-25, 4161👍, 0💬

How to disable an HTML object
How to disable an HTML object document.getElementById("myObj ect").disabled= true;
2008-12-16, 4161👍, 0💬

How to open a window with no toolbar, but with the location object.
How to open a window with no toolbar, but with the location object. window.open("http://www.mysite .org/Misc/Pennies","Pennies"," resizable=yes,status=yes,toolbar=yes,locatio n=yes,menubar=yes,scrollbars=y es,width=800,height=400");
2009-01-13, 4154👍, 0💬

How to find the selected radio button immediately using the this variable?
How to find the selected radio button immediately using the 'this' variable? &lt;script> function favAnimal(button) { alert('You like '+button.value+'s.'); } &lt;/script> &lt;input type="radio" name="marsupial" value="kangaroo" onchange="favAnimal(this)">Kan garoo&lt;br />&lt;inp...
2008-12-09, 4140👍, 0💬

How to get values from cookies to set widgets?
How to get values from cookies to set widgets? function getCookieData(labelName) { //from Danny Goodman var labelLen = labelName.length; // read cookie property only once for speed var cookieData = document.cookie; var cLen = cookieData.length; var i = 0; var cEnd; while (i &lt; cLen) { var j = ...
2009-01-20, 4139👍, 0💬

<< < 1 2 3 4 5 >   Sort: Date