分类目录归档:javascript

JS Librarys

中国: 新浪 http://lib.sinaapp.com jQuery htt … 继续阅读

发表在 javascript | 标签为 | JS Librarys已关闭评论

document width/height

网页可见区域宽: document.body.clientWidth;
网页可见区域高: document.body.clientHeight;
网页可见区域宽:
document.body.offsetWidth    (包括边线的宽);
网页可见区域高:
document.body.offsetHeight   (包括边线的宽);
网页正文全文宽: document.body.scrollWidth;
网页正文全文高: document.body.scrollHeight;
网页被卷去的高: document.body.scrollTop;
网页被卷去的左: document.body.scrollLeft;
网页正文部分上: window.screenTop;
网页正文部分左: window.screenLeft;
屏幕分辨率的高: window.screen.height;
屏幕分辨率的宽: window.screen.width;
屏幕可用工作区高度: window.screen.availHeight;
屏幕可用工作区宽度:window.screen.availWidth;

scrollHeight: 获取对象的滚动高度。  
scrollLeft:设置或获取位于对象左边界和窗口中目前可见内容的最左端...

继续阅读

发表在 javascript | document width/height已关闭评论

mobile check

if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))){
	if(window.location.href.indexOf("?mobile")<0){
		try{
			if(/Android|Windows Pho...

继续阅读

发表在 javascript | 标签为 | mobile check已关闭评论

js oauth_v1.0

/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://ww...

继续阅读

发表在 javascript | 标签为 , | js oauth_v1.0已关闭评论

PNG transparency in Win IE 5.5 & 6

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
    var arVersion = navigator.appVersion.split("MSIE")
    var version = parseFloat(arVersion[1])
    if ((version >= 5.5) && (document.body.filters))
    {
       for(var j=0; j<document.images...

继续阅读

发表在 javascript | PNG transparency in Win IE 5.5 & 6已关闭评论

innerHTML script

function parseScript(html)
{
	var result = { html:'',scripts:[] };
	if (html)
	{
		//脚本
		//var re = /(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig;
		var re = /(?:<script([^>]*text\/javascript[^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig;
		//外部脚本
	...

继续阅读

发表在 javascript | 标签为 , | innerHTML script已关闭评论