href="" will link to the same page as the one you are currently on, effectively refreshing the page. href="#" will not refresh the page, but using the # will make the screen move to the top of the page (it is the browser effectively looking for an anchor with no name, ). javascript:void(0) will prevent anything happening on the link at all.
Wednesday, October 12, 2011
Difference between href="#" and href="javascript:void(0)"
Labels:
Javascript
Returning Multiple Values in JAVASCRIPT
function myFunction() {
var result = testFunction();
alert(result[0]);//returns "1"
alert(result[1]);//returns "2"
alert(result[2]);//returns "3"
}
//This function returns multiple values(a,b,c) in the form of array.
function testFunction() {
var a="1",b="2",c="3";
return [a,b,c]
}
Labels:
Javascript
Subscribe to:
Posts (Atom)