以下Code在IE8下測試ok
<html> <head> </head> <body> aa <input type="button" name="btn1" value="click" onClick="DisplayMyName();"> </body> </html> <script> function DisplayMyName() { var myName = arguments.callee.toString(); myName = myName.substr('function '.length); myName = myName.substr(0, myName.indexOf('(')); alert(myName); } </script>
沒有留言:
張貼留言