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.
Why I keep getting error with the below code?
<!-- start sample code -->
<html>
<script language="javas cript">
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
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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.
Why I keep getting error with the below code?
<!-- start sample code -->
<html>
<script language="javas cript">
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
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Comment