H
Hiroshi Ochi
Hello,
Is it possible to initialize javascript function parameters (using MSIE
6.0 and above)? According to the link below, it seems possible to do
this.
http://www.mozilla.org/js/language/js20/rationale/named.html
Why I keep getting error with the below code?
<!-- start sample code -->
<html>
<script language="javascript">
function myFunc(paramOne,paramTwo="This is Default Message"){
alert('First Parameter is '+ paramOne );
alert('Second Parameter is '+ paramTwo );
}
<!-- first call -->
myFunc("My First Parameter message","My Second Parameter
Message");
<!-- second call -->
myFunc("My First Parameter message");
</script>
</html>
<!-- end sample code -->
I am expecting it to show the 'This is Default Message' in the second
call.
Would somebody give me a hint?
Thanks,
hiroshi
Is it possible to initialize javascript function parameters (using MSIE
6.0 and above)? According to the link below, it seems possible to do
this.
http://www.mozilla.org/js/language/js20/rationale/named.html
Why I keep getting error with the below code?
<!-- start sample code -->
<html>
<script language="javascript">
function myFunc(paramOne,paramTwo="This is Default Message"){
alert('First Parameter is '+ paramOne );
alert('Second Parameter is '+ paramTwo );
}
<!-- first call -->
myFunc("My First Parameter message","My Second Parameter
Message");
<!-- second call -->
myFunc("My First Parameter message");
</script>
</html>
<!-- end sample code -->
I am expecting it to show the 'This is Default Message' in the second
call.
Would somebody give me a hint?
Thanks,
hiroshi