jububianliang.htm

来自「网页编程是一门很好的语言.学会后可以设计自己的网站。」· HTM 代码 · 共 69 行

HTM
69
字号
<html>
<title>局部变量</title>
<head>
<script type ="text/javascript" language="javascript">

  var userName="global name";
  function test()
  {
  document.write(userName);
  document.write("<br>");
  var userName="local name";
  document.write(userName);
  return  true;
  }
  //test(); 
  //document("<br>");
  
  function write()
  {
  var astr="24" ;
  var anum=24;
  var x=astr+anum;
  var y=anum+astr;
  document.write(x);
  document.write("<br>");
  document.write(parseInt(y));
   return true;
  }
 // write();
  

 
  
  function read()
  {
  var a,b,c;
  var e,d=1,f=1,g="string",h,i="string";
  a=e||(d+2);
  b=(d-f)||"str";
  c=(f+3)||(g=2+"str");
  h=(d-f)||(i=2+"str");
  document.write(a);
  document.write("<br>");
  document.write(b);
  document.write("<br>");
  document.write(c):
  document.write("<br>");
  document.write(h);
  document.write("<br>");
  }
  return true;
 // read();
  
 function load()
 {
  document.();
  read();
  write();
  }


  
</script>

</head>
<body onload="load()">

</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?