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

javascript: The Browser Object Model(BOM)

window
window对象是浏览器或者框架自身.top总是浏览器,parent是父框架,self表示自己.
window通常可以省略.
窗口操作: moveBy(dx, dy), moveTo(x, y),
resizeBy(dw, dh), resizeTo(w, h).
导航: window.open(url, frame
name, attribute). attribute可以是left, top, height, width, resizable,
scrollable, toolbar, status, location(all default no). 
window.open
返回新窗口引用,并且有一个opener对象表示父窗口
window.close.
对话框:
alert, confirm, prompt.
状态栏: window.status, window.defaultStatus

间间隔和暂停: timeoutId = setTimeout("alert('hello world')", 1000);
clearTimeout(timeoutId);类似有setInterval和clearInterval.
历史:
window.history.go(+-n), history.back, history.forward. history.length
document
alert(window.document
== document) == true. 他是唯一一个既属于DOM又属于BOM的对象
属性:title, URL,
referrer, lastModified
集合属性: anchors, applets, embeds, forms,
images, links.
方法: write, writeln.
必须在完全载入页面前调用write()和writeln()方法. 如果任何一个方法是在页面载入后调用的,它将抹去页面的内容,显示指定的内容.
location
window和
document的属性,相互等价.
属性: hash(位于#后面的东西), host, hostname, href,
pathname, port, protocol, search(位于?后面的东西).
方法: assign(),
replace(), reload(false=从缓存中导入(default),true=从服务器端导入)
navigator和
screen对象
navigator对象表示了浏览器本身,可以获取一些属性,但是各个浏览器支持不同.
screen
对象可以得到用户系统的信息,如availHeight, availWidth(可用屏幕宽度和高度,排除了系统任务栏), colorDepth,
height, width.


相关文档:

js 判断当前浏览器JavaScript的版本

function RegExpTest(){
var ver = Number(ScriptEngineMajorVersion() + "." + ScriptEngineMinorVersion());
alert("version=="+ver);
if (ver >= 5.5){ // 测试 JScript 的版本。
var src = "The rain in Spain falls mainly in the plain.";
var re = /\w+/g; // ......

JavaScript调试方法之一

使用try{...}catch(){}  方式,例子如下:
function showAlarm(strObject){
try{
svgElement = document.getElementById(strObject);
svgElement.setAttribute("visibility","visible");
setTimeout("hideAlarm()",3000);//3秒后结束报警
}catch(ex){
alert("函数showAlarm()发生异常:"+ex.descrip ......

用javascript实现页面无刷新更新数据

程序设计中会经常碰到一种情况,就是事先无法得知用户会需要哪些数据,必须根据用户选择后再从服务器
重新提取数据后反馈给用户。比如一简单的情况,用户选择省份以后,我们立即会在市里边将这个省的所有
市重新显示出来。这种情况一般需要将整个页面刷新后才可以重新读取,但这样不仅效率不高外,也显得不
太优雅。其实 ......

javascript实用的N个小例子

版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://gzycm520.blog.51cto.com/175220/36822
· 事件源对象 event.srcElement.tagName event.srcElement.type
· 捕获释放 event.srcElement.setCapture();  ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号