易截截图软件、单文件、免安装、纯绿色、仅160KB

JavaScript中confirm,alert,prompt的用法

本文简要介绍JavaScript中confirm,alert,prompt的用法,希望大家学习过程中能得到一些启发。
window.confirm 参数就只有一个。显示提示框的信息。按确定,返回true;按取消返回false。
< SCRIPT> var bln = window.confirm("确定吗?"); alert(bln) < /SCRIPT> window.alert参数,只有一个,显示警告框的信息;无返回值。
< SCRIPT> window.alert("确定。") window.prompt参数,有两个,第一个参数,显示提示输入框的信息。第二个参数,用于显示输入框的默认值。返回,用户输入的值。
< SCRIPT> var str = window.prompt("请输入密码","password") alert(str); < /SCRIPT>


相关文档:

[翻译]High Performance JavaScript(029)

Working Around Caching Issues  关于缓存问题
    Adequate cache control can really enhance the user experience, but it has a downside: when revving up your application, you want to make sure your users get the latest version of the static content. This is accomplished by renaming ......

[翻译]High Performance JavaScript(032)

Fiddler
    Fiddler is an HTTP debugging proxy that examines the assets coming over the wire and helps identify any loading bottlenecks. Created by Eric Lawrence, this is a general purpose network analysis tool for Windows that provides detailed reports on any browser or web request. ......

javascript prototype介绍的文章

JavaScript是基于对象的,任何元素都可以看成对象。然而,类型和对象是不同的。本文中,我们除了讨论类型和对象的一些特点之外,更重要的是研究如何写出好的并且利于重用的类型。毕竟,JavaScript这种流行的脚本语言如果能够进行良好的封装,并形成一个庞大的类型库,对于重用是非常有意义的。
网上对于prototype的文章很 ......

javascript trim方法

在javascript中的string对象没有trim方法,所以trim功能需要自己实现:
代码如下:
Java代码
﹤scriptlanguage=”javascript”﹥   
/**  
*删除左右两端的空格  
*/  
String.prototype.trim=function(){      
  &nbs ......

JavaScript 调用表单重置方法


1 history.go(0)  
2 location.reload() (页面进行刷新,但为disabled的元素的值不会被清空)
3 location=location 
4 location.assign(location) 
5 location.replace(location) 
6 from..reset()  (页面不进行刷新,模拟单击对所调用表单重置按钮的单击)
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号