11/12, 91«89101112»

每日一Tip_JS跨域

2010-3-10 9:45:54 心得 抢沙发(0)

 

Chrome || Firefox中将同一域名下不同端口的访问也视为跨域操作。(JS)

-----来自团队总结

JavaScript Core namespace

2010-1-20 10:28:28 开发者 抢沙发(0)

 

Class IE
Mozilla
Netscape
Opera
Safari
An array of parameters passed to a function.
4.0+ 1.0+ 3.0+ 7.0+ 1.0+
An array is an ordered list of elements.
4.0+ 1.0+ 3.0+ 7.0+ 1.0+
The Boolean object is an object wrapper for a boolean value.
3.0+ 1.0+ 3.0+ 7.0+ 1.0+
Lets you work with dates and times.
3.0+ 1.0+ 2.0+ 7.0+ 1.0+
Enumerator is a proprietary Microsoft object that iterates over items in a group.
4.0+ no no no no
Represents a runtime error.
5.0+ 1.0+ 6.0+ 7.0+ 1.0+
The EvalError is thrown when the eval method is used incorrectly.
5.0+ 1.0+ 6.0+ no no
Every function in JavaScript is actually a Function object.
4.0+ 1.0+ 3.0+ 7.0+ 1.0+
The Global object is the parent of all globally avaliable properties and methods.
3.0+ 1.0+ 2.0+ 7.0+ no
A built-in object that has properties and methods for mathematical constants and functions. For example, the Math object's PI property has the value of pi.
3.0+ 1.0+ 2.0+ 7.0+ 1.0+
Lets you work with numeric values. The Number object is an object wrapper for primitive numeric values.
3.0+ 1.0+ 3.0+ 7.0+ 1.0+
Object is the primitive JavaScript object type. All JavaScript objects are descended from Object. That is, all JavaScript objects have the methods defined for Object.
4.0+ 1.0+ 2.0+ 7.0+ 1.0+
Thrown when a number is out of its appropriate range.
5.0+ 1.0+ 6.0+ no no
Thrown if reading a variable that does not exist.
5.0+ 1.0+ 6.0+ no no
Pattern for a regular expression.
4.0+ 1.0+ 4.0+ 7.0+ 1.0+
Represents the characters of a string.
3.0+ 1.0+ 2.0+ 7.0+ 1.0+
A SyntaxError is thrown if there is a syntax error in the JavaScript code.
5.0+ 1.0+ 6.0+ no no
A TypeError is thrown when a value is a different type than what was expected.
5.0+ 1.0+ 6.0+ no no
A URIError is thrown when there is an exception with URI encoding or decoding.
5.0+ 1.0+ 6.0+ no no

元素透明_IE_FF_Sar_Op_Cho

2009-12-10 13:28:02 开发者 抢沙发(0)

 

  1. pre {                               /* make the box translucent (80% opaque) */ 
  2.    border: solid red; 
  3.    opacity: 0.8;                    /* Firefox, Safari(WebKit), Opera */ 
  4.    -ms-filter: "alpha(opacity=80)"; /* IE 8 */ 
  5.    filter: alpha(opacity=80);       /* IE 4-7 */ 
  6.    zoom: 1;       /* set "zoom", "width" or "height" to trigger "hasLayout" in IE 7 and lower */  

 

ref:https://developer.mozilla.org/En/CSS:-moz-opacity

 

AJBrige core 发布

2009-11-12 16:53:03 AJBridge 抢沙发(0)

 具体信息见置顶

目标:
   “AS做AS的事(code),JS做JS的事(code),仅在沟通时用我(bridge)!"

特性

  1. 统一了事件
  2. 仅需3个功能函数就可以无障碍的 AS 和 JS 间通信
  3. 支持 单函数 或 多函数  的事件添加
  4. 事件传送在AS中基于 Event 类
  5. 事件定义方可由 AS 或 JS 或 双方共同约定 

[转]小字体小行高兼容性分析及差异解决办法

2009-11-12 13:08:56 开发者 抢沙发(0)

本文为转贴,因为本人也深刻体会。

原文地址:http://www.14px.com/?tag=line-height
作者:十四象素

[参与测试的浏览器:IE6 / IE7 / IE8 / FF3 / OP9.6 / SF3 / Chrome2 ]
[操作系统:Windows]

浏览器们缺乏党的教育,对行高没有统一的认识,于是在小字体小行高的情况下,总出现肉眼可见差异,对美观产生了举足轻重的影响。

要解决这一细节性的问题,我们首先得进行一番测试来了解各浏览器对于行高的认识,由于仅小行高和小字体影响比较大,我们就不探究其细节规律(比如字体大小对变化速度的影响规律)了,能在一定程度上解决问题便达到了我们想要的效果。

以下是经过一番头晕眼花的测试后得出的实验数据:

大小 行高 浏览器 宋体 Arial纯中文 Arial带英文字符
上边距 下边距 上边距 下边距 上边距 下边距
12px 14px ie6 0px 3px 0px 3px 1px 2px
12px 14px ie7 1px 2px 0px 3px 1px 2px
12px 14px ie8 1px 2px 0px 3px 1px 2px
12px 14px ff3 1px 2px 2px 1px 2px 1px
12px 14px chrome2 1px 2px 2px 1px 2px 1px
12px 14px op9.6 1px 2px 1px 2px 1px 2px
12px 14px sf3 1px 2px 1px 2px 1px 2px
 
12px 15px ie6 1px 3px 1px 3px 1px 3px
12px 15px ie7 2px 2px 1px 3px 1px 3px
12px 15px ie8 1px 3px 0px 4px 1px 3px
12px 15px ff3 1px 3px 2px 2px 2px 2px
12px 15px chrome2 1px 3px 2px 2px 2px 2px
12px 15px op9.6 1px 3px 1px 3px 1px 3px
12px 15px sf3 1px 3px 1px 3px 1px 3px
 
12px 16px ie6 1px 4px 1px 4px 2px 3px
12px 16px ie7 2px 3px 1px 4px 2px 3px
12px 16px ie8 2px 3px 1px 4px 2px 3px
12px 16px ff3 2px 3px 3px 2px 3px 2px
12px 16px chrome2 2px 3px 2px 3px 2px 3px
12px 16px op9.6 2px 3px 2px 3px 2px 3px
12px 16px sf3 2px 3px 2px 3px 2px 3px
 
12px 17px ie6 2px 4px 2px 4px 3px 3px
12px 17px ie7 3px 3px 2px 4px 3px 3px
12px 17px ie8 2px 4px 1px 5px 2px 4px
12px 17px ff3 2px 4px 3px 3px 3px 3px
12px 17px chrome2 2px 4px 3px 3px 3px 3px
12px 17px op9.6 2px 4px 2px 4px 2px 4px
12px 17px sf3 2px 4px 2px 4px 2px 4px

 

由表可见

1. 需要外观上非常完美的呈现单行文本垂直居中(没有1px的差异),需要设置字体为宋体。

解释:当字体为宋体的时候,各浏览器中上边距和下边距的差异都是较小的,出现问题的仅仅是IE6(行高为偶数时)与IE7(行高为奇数时),而IE6和IE7是可以很容易使用hack来通过padding的多少来精确控制其位置。

示例:

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
  2. <html xmlns="http://www.w3.org/1999/xhtml"> 
  3.     <head> 
  4.         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
  5.         <meta name="author" content="Chomo" /> 
  6.         <link rel="start" href="http://www.14px.com" title="Home" /> 
  7.         <title>line-height非常完美的兼容</title> 
  8.     </head> 
  9.     <style type="text/css"> 
  10.         * {margin:0; padding:0; list-style:none; }  
  11.         div { font-size:12px; font-family:simsun; line-height:15px; float:left; padding:1px 3px; *padding:0 3px 2px 3px; _padding:1px 3px; border:1px solid #000;}  
  12.     </style> 
  13.     <body> 
  14.         <div>十四像素 - 14px</div> 
  15.     </body> 
  16. </html> 

提示:你可以先修改部分代码再运行。

2. 如果确定标签内存在英文字符、数字、符号,可以设置英文字体,利用行高在15px下呈现的状态。

解释:此时仅ff3和chrome2浏览器存在些许差异,并且外观上不存在上多下少的边距。

示例:

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
  2. <html xmlns="http://www.w3.org/1999/xhtml"> 
  3.     <head> 
  4.         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
  5.         <meta name="author" content="Chomo" /> 
  6.         <link rel="start" href="http://www.14px.com" title="Home" /> 
  7.         <title>line-height:15px;font-family:arial时呈现比较理想的状态</title> 
  8.     </head> 
  9.     <style type="text/css"> 
  10.         * {margin:0; padding:0; list-style:none; }  
  11.         div { font-size:12px; font-family:arial; line-height:15px; float:left; padding:1px 3px; border:1px solid #000;}  
  12.     </style> 
  13.     <body> 
  14.         <div>十四像素 - 14px</div> 
  15.     </body> 
  16. </html> 

提示:你可以先修改部分代码再运行。

3. 如果不能保证是否存在英文字符、数字、符号,又需要设置英文字体保证美观,也可利用行高在15px下呈现的状态。(推荐)

解释:此时ie8浏览器下的状态不容乐观,上下差异太大:上0px,下4px,但可以利用:before伪类,赐它一个符号。

示例:

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
  2. <html xmlns="http://www.w3.org/1999/xhtml"> 
  3.     <head> 
  4.         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
  5.         <meta name="author" content="Chomo" /> 
  6.         <link rel="start" href="http://www.14px.com" title="Home" /> 
  7.         <title>line-height:15px;font-family:arial时呈现比较理想的状态(即使是纯中文)</title> 
  8.     </head> 
  9.     <style type="text/css"> 
  10.         * {  
  11.             margin:0;  
  12.             padding:0;  
  13.             list-style:none;  
  14.         }  
  15.         div {  
  16.             font-size:12px;  
  17.             font-family:arial;  
  18.             line-height:15px;  
  19.             float:left;  
  20.             padding:1px 3px;  
  21.             border:1px solid #000;  
  22.         }  
  23.         div:before {  
  24.             content:"1";  
  25.             margin-left:-2000px;  
  26.             margin-right:1993px;  
  27.         }  
  28.     </style> 
  29.     <body> 
  30.         <div>十四像素</div> 
  31.     </body> 
  32. </html> 

提示:你可以先修改部分代码再运行。

AJBridge

2009-11-6 11:07:56 开发者 抢沙发(3)

github.com/kissyteam

从2010年6月起,正式加入 kissy 开源项目。

什么是Kissy? 

 

小巧灵活,简洁实用,
使用起来让人感觉愉悦。

Keep It
  Simple & Stupid,
  Short & Sweet,
  Slim & Sexy...
Yeah!

 

咱们已搬迁至 github!

 

访问我们: 

 http://github.com/kissyteam    

关于此次迁移的介绍 :

http://lifesinger.org/blog/2010/07/kissy-on-github-com/

关于github 的 kissy介绍:

http://lifesinger.org/blog/2010/08/release-kissy-1-1-0/

 

 

介绍详细的请看这里

 

Kissy 的项目主页

 

 

项目成员“手气不错”也有专门的一片博文作宣传


 

档案号:116

My  Frist  Open  Source Project

 

Global:

 "AS do AS things (code), JS do JS things (code), only communicate with me (bridge)"

 

(AS and JS are doing their own things, only use bridge in communication.)

 

目标:
   “AS做AS的事(code),JS做JS的事(code),仅在沟通时用我(bridge)!"

已迁移并寄生于Kissy

project home :  http://code.google.com/p/ajbridge/

svn:  http://ajbridge.googlecode.com/svn/trunk/

 

11/12, 91«89101112»