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

Example of using Regular Expressions for syntax checking in JavaScript
Example of using Regular Expressions for syntax checking in JavaScript ... var re = new RegExp("^(&[A-Za-z_0-9]{1, }=[A-Za-z_0-9]{1,})*$");var text = myWidget.value; var OK = re.test(text); if( ! OK ) { alert("The extra parameters need some work.\r\n Should be something like: \"&a=1&c=4\...
2010-07-13, 3623👍, 0💬

What does JavaScript null mean?
What does JavaScript null mean? The null value is a unique value representing no value or no object. It implies no object, or null string, no valid boolean value, no number and no array object.
2010-12-14, 3622👍, 0💬

What’s a quick way to append a value to an array?
What’s a quick way to append a value to an array? arr[arr.length] = value;
2010-12-28, 3597👍, 0💬

What does the term sticky session mean in a web-farm scenario?
What does the term sticky session mean in a web-farm scenario? Why would you use a sticky session? What is the potential disadvantage of using a sticky session? Sticky session refers to the feature of many commercial load balancing solutions for web-farms to route the requests for a particular sessi...
2011-01-04, 3596👍, 0💬

How about 2+5+"8"?
How about 2+5+"8"? Since 2 and 5 are integers, this is number arithmetic, since 8 is a string, it’s concatenation, so 78 is the result.
2010-11-16, 3596👍, 0💬

How to put a "close window" link on a page?
How to put a "close window" link on a page? &lt;a href='javascript:window.close( )'class='mainnav'> Close &lt;/a>
2010-11-30, 3595👍, 0💬

What's Prototypes for JavaScript?
What's Prototypes for JavaScript? Objects have "prototypes" from which they may inherit fields and functions. &lt;script type="text/javascript"> function movieToString() { return("title: "+this.title+" director: "+this.director); } function movie(title, director) { this.title = title; this.direc...
2011-08-23, 3593👍, 0💬

How to add Buttons in JavaScript?
How to add Buttons in JavaScript? The most basic and ancient use of buttons are the "submit" and "clear", which appear slightly before the Pleistocene period. Notice when the "GO!" button is pressed it submits itself to itself and appends the name in the URL. &lt;form action="" name="buttonsGalo...
2010-07-13, 3583👍, 0💬

How to create an input box?
How to create an input box? prompt("What is your temperature?");
2011-03-08, 3581👍, 0💬

How to create an object using JavaScript?
How to create an object using JavaScript? Objects can be created in many ways. One way is to create the object and add the fields directly. &lt;script type="text/javascript"> var myMovie = new Object(); myMovie.title = "Aliens"; myMovie.director = "James Cameron"; document.write("movie: title is...
2011-08-02, 3580👍, 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...
2010-12-07, 3577👍, 0💬

What boolean operators does JavaScript support?
What boolean operators does JavaScript support? &amp;&amp;, || and !
2010-09-28, 3571👍, 0💬

What is a fixed-width table and its advantages?
What is a fixed-width table and its advantages? Fixed width tables are rendered by the browser based on the widths of the columns in the first row, resulting in a faster display in case of large tables. Use the CSS style table-layout:fixed to specify a fixed width table. If the table is not specifie...
2010-07-06, 3567👍, 0💬

Name the numeric constants representing max, min values
Name the numeric constants representing max, min values Number.MAX_VALUE Number.MIN_VALUE
2010-12-14, 3563👍, 0💬

How to create a function using function constructor?
How to create a function using function constructor? The following example illustrates this. It creates a function called square with argument x and returns x multiplied by itself. var square = new Function ("x","return x*x");
2011-08-16, 3555👍, 0💬

How do you assign an object's property in JavaScript?
How do you assign an object's property in JavaScript? A) obj("age") = 30; B) obj.age = 30; C) Both a and b above D) None of the above
2010-08-28, 3555👍, 0💬

How to write a script manage a list using JavaScript?
How to write a script manage a list using JavaScript? 1. To remove an item from a list: set it to null: myList[3] = null; 2. To truncate a list: reset the length property: myList.length = 2; 3. To delete all items in a list, set the length to 0: myList.length = 0;
2010-08-24, 3549👍, 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
2011-01-18, 3541👍, 0💬

What does break and continue statements do?
What does break and continue statements do? Continue statement continues the current loop (if label not specified) in a new iteration whereas break statement exits the current loop.
2011-08-16, 3521👍, 0💬

What Web sites do you feel use JavaScript most effectively (i.e., best-in-class examples)? The worst?
What Web sites do you feel use JavaScript most effectively (i.e., best-in-class examples)? The worst? The best sites are the ones that use JavaScript so transparently, that I'm not aware that there is any scripting on the page. The worst sites are those that try to impress me with how much scripting...
2010-11-09, 3518👍, 0💬

The eval() method is incredibly powerful because it:
The eval() method is incredibly powerful because it: A) allows you to execute snippets of code during execution. B) allows you to evaluate for enough resources. C) allows you to evaluate and validate user input. D) all of the above.
2010-08-28, 3513👍, 0💬

How do you create a new object in JavaScript?
How do you create a new object in JavaScript? var obj = new Object(); or var obj = {};
2010-12-21, 3512👍, 0💬

How to create arrays in JavaScript?
How to create arrays in JavaScript? We can declare an array like this var scripts = new Array(); We can add elements to this array like this scripts[0] = "PHP"; scripts[1] = "ASP"; scripts[2] = "JavaScript"; scripts[3] = "HTML"; Now our array scrips has 4 elements inside it and we can print or acces...
2010-06-22, 3509👍, 0💬

How can JavaScript be used to improve the "look and feel" of a Web site? By the same token, how can JavaScript be used to improv
How can JavaScript be used to improve the "look and feel" of a Web site? By the same token, how can JavaScript be used to improve the user interface? On their own, Web pages tend to be lifeless and flat unless you add animated images or more bandwidth-intensive content such as Java applets or other ...
2010-06-15, 3509👍, 0💬

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