<html> <head> <title>wodeweb</title> </head> <body> <script type="text/javascript"> var PI="PI的值为:"; var value="3.1415926"; function getPI() { var value="3.14";//注意这里的局部变量 alert((this===window)+" "+this.PI+this.parseFloat(this.value));//注意,这里是this.value不是value } window.getPI();//等于getPI() </script> </body> </html>