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>
相关文档:
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 ......
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是基于对象的,任何元素都可以看成对象。然而,类型和对象是不同的。本文中,我们除了讨论类型和对象的一些特点之外,更重要的是研究如何写出好的并且利于重用的类型。毕竟,JavaScript这种流行的脚本语言如果能够进行良好的封装,并形成一个庞大的类型库,对于重用是非常有意义的。
网上对于prototype的文章很 ......
在javascript中的string对象没有trim方法,所以trim功能需要自己实现:
代码如下:
Java代码
﹤scriptlanguage=”javascript”﹥
/**
*删除左右两端的空格
*/
String.prototype.trim=function(){
&nbs ......
1 history.go(0)
2 location.reload() (页面进行刷新,但为disabled的元素的值不会被清空)
3 location=location
4 location.assign(location)
5 location.replace(location)
6 from..reset() (页面不进行刷新,模拟单击对所调用表单重置按钮的单击)
......