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

browser incompatibilities aside
Keeping browser incompatibilities aside, an event can be registered except: A) (input type="button" id="btn" name="btn" value="Click" onclick="handler()" /) B) document.getElementById("btn") .onclick= function() { alert("handler!"); } C) document.getElementById("btn") .addEventListener("onclick",han...
2010-08-28, 4394👍, 0💬

What is negative infinity?
What is negative infinity? It’s a number in JavaScript, derived by dividing negative number by zero.
2010-08-10, 4393👍, 0💬

How many times will the following loop print the word loop to the screen?
How many times will the following loop print the word loop to the screen? var index = 0; while (index < 3) { window.document.writeln("loop" );index++; } A) 1 B) 2 C) 3 D) 4
2010-08-28, 4389👍, 0💬

Can JavaScript steal text from your clipboard?
Can JavaScript steal text from your clipboard? It is true, text you last copied for pasting (copy & paste) can be stolen when you visit web sites using a combination of JavaScript and ASP (or PHP, or CGI) to write your possible sensitive data to a database on another server.
2010-08-24, 4384👍, 0💬

What does "1"+2+4 evaluate to?
What does "1"+2+4 evaluate to? Since "1" is a string, everything is a string, so the result is a string of "124".
2010-09-28, 4365👍, 0💬

How to determine the state of a checkbox using JavaScript?
How to determine the state of a checkbox using JavaScript? Use the "checked" property of the checkbox object. For example: var checkedP = window.document.getElementById ("myCheckBox").checked;
2010-10-19, 4328👍, 0💬

How is JavaScript different from Java?
How is JavaScript different from Java? JavaScript was developed by Brendan Eich of Netscape; Java was developed at Sun Microsystems. While the two languages share some common syntax, they were developed independently of each other and for different audiences. Java is a full-fledged programming langu...
2010-05-11, 4321👍, 0💬

What is the difference of decodeURI() and encodeURI()?
What is the difference of decodeURI() and encodeURI()? Many characters cannot be sent in a URL, but must be converted to their hex encoding. These functions are used to convert an entire URI (a superset of URL) to and from a format that can be sent via a URI. &lt;script type="text/javascript"> v...
2011-08-30, 4312👍, 0💬

How to Add Event Handlers?
How to Add Event Handlers? You can add an event handler in the HTML definition of the element like this: &lt;script type="text/javascript">&lt ;!--function hitme() { alert("I've been hit!"); } // --&gt; &lt;/script> &lt;input type="button" id="hitme" name="hitme" value="hit me" o...
2011-05-24, 4312👍, 0💬

How do you convert numbers between different bases in JavaScript?
How do you convert numbers between different bases in JavaScript? Use the parseInt() function, that takes a string as the first parameter, and the base as a second parameter. So to convert hexadecimal 3F to decimal, use parseInt ("3F", 16);
2010-06-22, 4311👍, 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, 4306👍, 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.
2011-01-25, 4300👍, 0💬

How to set the focus in an element using JavaScript?
How to set the focus in an element using JavaScript? Use the "focus()" method of the element object: &lt;script> function setFocus() { if(focusElement != null) { document.forms[0].elements["my elementname"].focus();} } &lt;/script>
2010-10-19, 4288👍, 0💬

What is the difference between a web-garden and a web-farm?
What is the difference between a web-garden and a web-farm? Web-garden - An IIS 6.0 feature where you can configure an application pool as a web-garden and also specify the number of worker processes for that pool. It can help improve performance in some cases. Web-farm - A general term referring to...
2010-10-12, 4280👍, 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, 4277👍, 0💬

What can JavaScript programs do?
What can JavaScript programs do? Generation of HTML pages on-the-fly without accessing the Web server. The user can be given control over the browser like User input validation Simple computations can be performed on the client's machine The user's browser, OS, screen size, etc. can be detected Date...
2010-07-20, 4271👍, 0💬

What is the eval() function?
What is the eval() function? The eval() method is incredibly powerful allowing you to execute snippets of code during exection. &lt;script type="text/javascript"> var USA_Texas_Austin = "521,289"; document.write("Population is "+eval("USA_"+"Texas_"+"Austin "));&lt;/script> This produces: Po...
2011-08-09, 4264👍, 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, 4248👍, 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, 4243👍, 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, 4222👍, 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, 4219👍, 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, 4216👍, 0💬

How can JavaScript be used to personalize or tailor a Web site to fit individual users?
How can JavaScript be used to personalize or tailor a Web site to fit individual users? JavaScript allows a Web page to perform "if-then" kinds of decisions based on browser version, operating system, user input, and, in more recent browsers, details about the screen size in which the browser is run...
2010-07-27, 4213👍, 0💬

Taking a developer’s perspective, do you think that that JavaScript is easy to learn and use?
Taking a developer’s perspective, do you think that that JavaScript is easy to learn and use? I think JavaScript is easy to learn. One of the reasons JavaScript has the word "script" in it is that as a programming language, the vocabulary of the core language is compact compared to full-fledged prog...
2010-11-09, 4211👍, 0💬

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