当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

    摘要: 大家团结起来!帮帮php的同仁 ......
 ·application中如何加载类    »显示摘要«
    摘要: 我另外做了一个类,实现需要实例化,想在一开始就加载,所以想在application中加载,可以<object id="terminal_train_sets" runat="server" scope="application" class="system.collections.hashtable" /......


JavaScript 中用什么函数可以弹出一个窗口出来,并且可以输入字符串

JavaScript   中用什么函数可以弹出一个窗口出来,并且可以输入字符串?  
  怎样接收这个字符串?     希望能有一个例子,谢谢!!!

NO.1   作者: meizz

var   mm   =   prompt("提示",   "缺省值");  
  alert(mm);  
 

NO.2   作者: slumcherry

<html>  
  <head>  
  <title>  
  </title>  
  <script   language="javascript">  
  <!--  
  function   show()  
  {  
      var   name  
      name=window.prompt("please   enter   your   name:","")  
      window.alert(name)  
   
  }  
  //-->  
  </script>  
  </head>  
  <body>  
  <input   type="button"   name="button1"   value="click"     onclick="show()">  
  </body>  
  </html>  
  这个例子是点击按钮才出现对话框,且名字是由一新的窗口显示。如果想显示到页面上,只用把  
  window.alert(name)换成:  
  document.write(name)  
  document.close()  
  如果想页面完全载入后直接弹出窗口,则如下:  
  <html>  
  <head>  
  <title>  
  </title>  
  <script   language="javascript">  
  <!--  
  function   show()  
  {  
      var   name  
      name=window.prompt("please   enter   your   name:","")  
      document.write(name)  
      document.close()  
  }  
  //-->  
  </script>  
  </head>  
  <body   onload="show()">  
  </body>  
  </html>

NO.3   作者: hansun

prompt   method  
  Displays   a   Prompt   dialog   box   with   a   message   and   an   input   field.    
   
  语法  
  prompt(message,   [inputDefault])  
  message   is   any   string   or   a   property   of   an   existing   object;   the   string   is   displayed   as   the   message.    
  inputDefault   is   a   string,   integer,   or   property   of   an   existing   object   that   represents   the   default   value   of   the   input   field.

NO.4   作者: voidroom

prompt("title","value")  
  alert("msg")  
  confirm("msg")

NO.5   作者: voidroom

function   inp()  
  {  
    var   msg;  
    msg=prompt("请输入字符串:","输入这里");  
  alert("输入信息是:"+msg);  
  }

NO.6   作者: wjcking

可以,用window.open或showmodeldialg做


    摘要: 我想用来学习用,有的话,请各位大虾给个地址,谢谢! ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE