<< < 4 5 6 7 8 9 10 >   Sort: Date

What are the ways to emit client-side JavaScript from server-side code in ASP.NET?
What are the ways to emit client-side JavaScript from server-side code in ASP.NET? The Page object in ASP.NET has two methods that allow emitting of client-side JavaScript: RegisterClientScriptBlock and RegisterStartupScript. Example usage: Page.RegisterClientScriptBlock ("ScriptKey","&lt;script...
2010-10-05, 3395👍, 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...
2011-02-22, 3389👍, 0💬

Are Java and JavaScript the Same?
Are Java and JavaScript the Same? No. java and JavaScript are two different languages. Java is a powerful object - oriented programming language like C++ and C, whereas Javascript is a client-side scripting language.
2010-09-14, 3381👍, 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,...
2011-07-05, 3379👍, 0💬

How to remove the event listener?
How to remove the event listener? &lt;script type="text/javascript">&lt ;!--document.getElementById("hitme 4").removeEventListener("click ",hitme4, false); // --&gt; &lt;/script> Key Events "onkeydown", "onkeypress", "onkeyup" events are supported both in ie and standards-based browse...
2011-05-31, 3377👍, 0💬

How do you target a specific frame from a hyperlink?
How do you target a specific frame from a hyperlink? Include the name of the frame in the target attribute of the hyperlink. &lt;a href=”mypage.htm” target=”BodyFrame”>>Next&l t;/a>
2010-06-29, 3376👍, 0💬

How to delete an entry using JavaScript?
How to delete an entry using JavaScript? The "delete" operator removes an array element, but oddly does not change the size of the array. &lt;script type="text/javascript"> var days = ["Sunday","Monday","Tuesday"," Wednesday","Thursday","Friday","Saturday" ];document.write("Number of days:"+days...
2011-07-19, 3353👍, 0💬

How do you assign object properties?
How do you assign object properties? obj["age"] = 17 or obj.age = 17.
2010-12-21, 3349👍, 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...
2011-02-08, 3344👍, 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 ...
2011-06-21, 3341👍, 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".
2011-06-21, 3330👍, 0💬

How to embed JavaScript in a web page?
How to embed JavaScript in a web page? javascript code can be embedded in a web page between &lt;script langugage="javascript"> your scripts here &lt;/script> tags.
2010-09-14, 3326👍, 0💬

How to have an element invoke a JavaScript on selection, instead of going to a new URL:
How to have an element invoke a JavaScript on selection, instead of going to a new URL: &lt;script type="text/javascript"> function pseudoHitMe() { alert("Ouch!"); } &lt;/script> &lt;a href="javascript:pseudoHitMe() ">hitme&lt;/a>
2011-02-22, 3317👍, 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...
2011-02-01, 3316👍, 0💬

When is the following statement true?
When is the following statement true? if (day = " 26 ") a) When the variable age equals 26 b) This statement is never true c) This stattement is always true d) If it is the twenty sixth day of the month
2010-08-28, 3302👍, 0💬

Can JavaScript code be broken in different lines?
Can JavaScript code be broken in different lines? Breaking is possible within a string value by using a backslash \ at the end of the line. But this technique can not be used within any other values. For example: document.write("Hello \ world");
2010-11-02, 3299👍, 0💬

How to use strings as array indexes using JavaScript?
How to use strings as array indexes using JavaScript? Javascript does not have a true hashtable object, but through its wierdness, you can use the array as a hashtable. &lt;script type="text/javascript"> var days = ["Sunday","Monday","Tuesday"," Wednesday","Thursday","Friday","Saturday" ];for(va...
2011-07-19, 3289👍, 0💬

How to use "join()" to create a string from an array using JavaScript?
How to use "join()" to create a string from an array using JavaScript? "join" concatenates the array elements with a specified seperator between them. &lt;script type="text/javascript"> var days = ["Sunday","Monday","Tuesday"," Wednesday","Thursday","Friday","Saturday" ];document.write("days:"+d...
2011-07-26, 3278👍, 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."); }
2011-06-28, 3241👍, 0💬

How to create a popup warning box?
How to create a popup warning box? alert('Warning: Please enter an integer between 0 and 100.');
2011-03-01, 3216👍, 0💬

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
2011-01-25, 3210👍, 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");
2011-05-15, 3188👍, 0💬

What's Math Constants and Functions using JavaScript?
What's Math Constants and Functions using JavaScript? The Math object contains useful constants such as Math.PI, Math.E Math also has a zillion helpful functions. Math.abs(value); //absolute value Math.max(value1, value2); //find the largest Math.random() //generate a decimal number between 0 and 1 ...
2011-07-05, 3184👍, 0💬

How to force a page to go to another page using JavaScript?
How to force a page to go to another page using JavaScript? &lt;script language="JavaScript" type="text/javascript" >&lt;!-- location.href="http://newhost/ newpath/newfile.html";//-->&lt;/script>
2011-06-14, 3117👍, 0💬

<< < 4 5 6 7 8 9 10 >   Sort: Date