我的最佳解决方案
<script>
function tofull(){
var file =self.location;
var a = window.open("about:blank","","fullscreen=yes")
self.opener=null
self.close()
a.moveTo(0,0)
a.resizeTo(screen.Width,screen.Height)
a.focus();
a.location=file;
}
</script>
这是一个演示程序,点击下面的“全屏显示”按钮,将使本页实现全屏显示。
<p align=center><input type="button" value="全屏显示" onclick=tofull()></p>

解决方案 »

  1.   

    javascript用于参数传递somehtml.html
    ------------
    <script language="javascript">
    var Request = new Array();
    function init()
    {
      var s = location.search.substring(1);
      if (s && s!=""){
       var list = s.split("&");
    for (var i=0; i < list.length; i++){
    var pair = list[i].split("=");
    if (pair[0] && pair[0] !=""){
    Request[unescape(pair[0])] = unescape(pair[1]);
    }
    }
      }  var item;
      s = "";
      for (item in Request){
    s += item + "=" + Request[item] + "<br>";
      }  dvShow.innerHTML = s;
      alert(dvShow.innerHTML);
    }
    </script>
    <body onload="init()">
    <div id="dvShow"> </div>
    </body>testform.html
    -----------------
    <html>
    <head>
    </head>
    <body>
    <form action="somehtml.html" method="get">
    <input name="x">
    <input name="y">
    <input type="submit" name="submit" value="submit">
    </form>
    </body>
    </html>
      

  2.   

    从js中可以看到java等高级语言的影子,下面是一个简单的toString例子function Cls(){
      this.toString=function(){
        return "i am Cls"
      }
    }var cls1=new Cls()document.write(cls1)       //will write "i am Cls"
    alert(cls1)                //will be "i am Cls"