没有样式就是最好的样式

Archive for November, 2005


RSS VS Atom

Nov 13, 2005 Author: | Filed under: Uncategorized

RSS 2.0 and Atom 1.0, Compared

无论从哪个方面看,Atom都棋胜一招…

[Edit on 2005-11-13 21:55:44 By guoshuang]

xhtml的反对声音

Nov 13, 2005 Author: | Filed under: Uncategorized

原文在 XHTML Considered Harmful,大致罪状有8条,不管对错,至少可以参考:

1. document.write is not supported

严格的 xhtml(包含正确的MIME类型)不支持 document.write()。原因在于“可能”会导致不完整标签(比如script中write一个

开始,而结束

直接写在 html 代码中)。

2. iframes are not supported

不支持 iframe,看昨天文章,可用 object 替代。

3. Custom attributes are sinful

自定义属性有罪。

4. The XHTML layout engines are slower and buggier

XHTML框架的(浏览器)引擎又慢问题又多

5. Internet Explorer does not support XHTML

IE不支持真正的(MIME为application/xhtml+xml)XHTML。文中还说
中 斜线和br 之间的空格就是写给IE看的。

6. XHTML has to be sent using incorrect MIME types

只能提供不正确的MIME类型。(目前大多都提供的是 text/html)

7. The W3C’s MITization of the web is not a good thing

(不知如何翻译,总之,历数W3C这些年提供技术规范的漏洞百出)

8. XHTML provides no benefits

xhtml没任何好处。

最后,作者总结了这么一句话:

Well designed, semantic HTML is enough.

guoshuang2005-11-13+可是假如不 xhtml 化,xml类应用(比如feed,foaf)怎么玩?

[Edit on 2005-11-13 12:10:21 By guoshuang]

508 中需要注意的条目

Nov 11, 2005 Author: | Filed under: Uncategorized

都是些平常不注意的地方。

表格中使用 scope

显示更多

The efficiency of using the scope attribute becomes more apparent in much larger tables. For instance, if an agency used a table with 20 rows and 20 columns, there would be 400 data cells in the table. To make this table comply with this provision without using the scope attribute would require special coding in all 400 data cells, plus the 40 header and row cells. By contrast, using the scope attribute would only require special

attributes in the 40 header and row cells.

Using the “ID” and “Headers” Attributes in Tables

来自:

http://www.access-board.gov/sec508/guide/1194.22.htm

参考资料:

understanding accessibility

WCAG(Web Content Accessibility Guidelines 1.0)

508 Verifacation工具

普通验证

http://www.contentquality.com/mynewtester/cynthia.exe?Url1=完整地址

详细报告

http://www.hisoftware.com/accmonitorsitetest/genreport.aspx?rptmode=-1&runcr=1&完整地址

时间长,更加详细的分析报告

http://webxact2.watchfire.com/

看到 watchfire 中 WCAG 2 3 的报告部分都快崩溃了,需要修改添加的东西可真不少。

Priority 1 Checkpoints

1.If an image conveys important information beyond what is in its alternative text, provide an extended description.(alt和longdesc,后者提供详细说明 .txt)

2. Synchronize equivalent alternatives with multimedia presentations.非文字内容给文字说明(object中间说明)

3.If a table has two or more rows or columns that serve as headers, use structural markup to identify their hierarchy and relationship.

表格中应该使用以下描述

* To group rows, use THEAD, TFOOT, and TBODY

* To group columns, use COL and COLGROUP

* To describe complex relationships among data, use the “axis” and “scope” attributes.

Scope specifies the set of data cells to be associated with the current header cell and must have one of the following values: “row”, “col”, “rowgroup” or “colgroup”.

4. Provide accessible alternatives to the information in scripts, applets, or objects.除了object,script也要给出noscript 部分。

Priority 2 Checkpoints

1. Make sure event handlers do not require use of a mouse.(上面google本站搜索部分)

2.Do not use the same link phrase more than once when the links point to different URLs. 链接地址不同,链接文字也应该不一样

Priority 3 Checkpoints

1.Separate adjacent links with more than whitespace.

2.Include default, place-holding characters 表单元素默认值

3. Provide a summary for tables.

Cynthia 验证

收到两个警告:

1.Validate that Alternative Text is greater than 7 and less than 81 characters in length

alt说明文字最好不要多于81,少于7个字(俺是中文又不是英文单词)

2.INPUT Element, of Type TEXT, found at Line: 203, Column: 363 contains a non-empty ‘value’ attribute. This is a practice referred to as “self-labeling.” Self-Labeling is argued to be accessible under Priority One or Section 508 guidelines/standards. We recommend using a Label as the Preferred method or the use of an ‘alt’ attribute to make this element accessible.

input 虽然可用预定义value来作说明,但还是推荐使用label。(简直就是没事找事)

[Edit on 2005-11-12 11:29:30 By guoshuang]

iframe 在 xhtml 中的替换方案

Nov 11, 2005 Author: | Filed under: Uncategorized

今天发现验证错误,strict xhtml中没有iframe标签,找了些资料,其实就一句话,用object 替换即可。

显示更多

bookmarklets书写技巧

Nov 11, 2005 Author: | Filed under: Uncategorized

Strings

In Javascript you can use both single quotes ( ‘xxx’ ) and double quotes ( “xxx” ) in string expressions. If you want a string inside a string you can write it like this: s=’x=”hello”;’. Since you should always use single quotes (it makes it easier to distribute your bookmarklets), you should in stead write it like this: s=’x=’hello’;’. The backslash before the apostrophes means the apostrophe should be considered a character inside the string.

Literalised single quotes (that’s what they’re called when they have a backslash in front) are also practical when you have words or sentences that use apostrophes, like so: s=’Rock’n'roll isn’t dead’.

Finally, you can sometimes use the escape and unescape functions. unescape(%27) is a single quote. The browser will automatically render it as a single quote when the bookmarklet executes.

The function() Trick

Tired of using void to catch return values? If you put the statement (function(){…})() around your code it is encapsulated so you automatically catch all return values. The (function(){…}) part creates a nameless function. The () part runs it. This works in all browsers. Example:

javascript:

(function(){

x=3;

lnks=document.links;

document.links[0].href=’http://www.ibm.com/’;

})

()

Normally you would have to use void to catch the return values (see explanation on the rules page), but using the function() trick you don’t have to worry about that.

Script Inclusion

When you want to create bookmarklets with extensive logic it can be a good idea to create an external javascript file ( *.js), then include this file in the currently loaded page.

So far only Internet Explorer allows you to do this. Here’s the code:

var script=document.createElement(’script’);

script.src=’http://…mysite…/…myscript.js’;

document.getElementsByTagName(’head’)[0].appendChild(script);

/* Call functions found in myscript.js here */

Alternatively, have your bookmarklet open a new window. In the document of this new window you write a copy of the current document, with the exception that you slip in your script reference, using the ‘);

var win=open();

with(win.document){

open();

write(src);

close();

}

/* Manipulate win using myscript.js functions */

以上技巧来自:

http://www.subsimple.com/bookmarklets/tips.asp

更多技巧:

http://www.subsimple.com/bookmarklets/links.asp#Articles

[Edit on 2005-11-11 13:22:58 By guoshuang]

推广firefox赚取1美金

Nov 11, 2005 Author: | Filed under: Uncategorized

有好事者,在页面中放置

图标,并且加入 google adSense 从而牟利…

方法见原文

BTW:如此版本的 杀死比尔

[Edit on 2005-11-11 9:31:18 By guoshuang]