Dom遵守 [英] Dom compliance

查看:80
本文介绍了Dom遵守的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一名设计师,他努力在我的所有网络工作中使用符合标准的最佳

做法。 Javascript是一个我觉得很无知的领域,并且不知道怎么分辨出什么是符合

目前的最佳实践,什么不是。是否有某种类似于w3c对xhtml和css的验证器?
验证器?是否有东西要看

代码告诉你它是否适合鼻烟?


例如,我得到了这个令人愉快的简洁的脚本

将浏览器调整为全屏。我发现它很优雅,并且要点
点(比过去我用过的代码要干得多)。

但是,它仅适用于IE和Firefox。没有歌剧。没有Netscape。

修复简单和小,还是我必须回到过去复杂的

脚本?


这是代码:


self.moveTo(0,0)

self.resizeTo(screen.availWidth,screen.availHeight)

I am a designer who is pushing hard to use standards compliant best
practices in all of my web work. Javascript is an area where I feel
pretty ignorant, and don''t know how to tell what is compliant with
current best practices, and what isn''t. Is there some sort of
validator like the w3c has for xhtml and css? Are there things to look
for in code that tell you if it''s up to snuff or not?

For instance, i was given this delightfully concise script for
resizing a browser to full screen. I find it to be elegant, and to-the-
point (much cleaner than the code forking stuff I''d used in the past).
However, it only works in IE and Firefox. No Opera. No Netscape. Is
the fix simple and small, or do I have to go back to the complicated
scripts of the past?

Here''s the code:

self.moveTo(0,0)
self.resizeTo(screen.availWidth,screen.availHeight )

推荐答案

nitrospectide说:
nitrospectide said:

>
我是一个设计师正努力在我的所有网络工作中使用符合标准的最佳实践。 Javascript是一个我觉得非常无知的领域,并且不知道如何分辨什么符合当前的最佳实践,什么不是。有没有像w3c那样的xhtml和css的验证器?有没有什么东西可以在代码中找到,告诉你它是否适合鼻烟?

例如,我给了这个令人愉快的简洁脚本来调整大小浏览器全屏显示。我发现它很优雅,并且指向(比我过去使用过的代码要干得多)。
但是,它只适用于IE和Firefox。没有歌剧。没有Netscape。
修复是否简单和小,还是我必须回到过去复杂的脚本?

这里是代码:

self.moveTo(0,0)
self.resizeTo(screen.availWidth,screen.availHeigh t)
>
I am a designer who is pushing hard to use standards compliant best
practices in all of my web work. Javascript is an area where I feel
pretty ignorant, and don''t know how to tell what is compliant with
current best practices, and what isn''t. Is there some sort of
validator like the w3c has for xhtml and css? Are there things to look
for in code that tell you if it''s up to snuff or not?

For instance, i was given this delightfully concise script for
resizing a browser to full screen. I find it to be elegant, and to-the-
point (much cleaner than the code forking stuff I''d used in the past).
However, it only works in IE and Firefox. No Opera. No Netscape. Is
the fix simple and small, or do I have to go back to the complicated
scripts of the past?

Here''s the code:

self.moveTo(0,0)
self.resizeTo(screen.availWidth,screen.availHeigh t)



首先要考虑的是调整窗口大小本身是否符合当前的最佳实践。我相信那是不。


在某些内部网应用程序中,它可能是可以接受的,你需要确保用户的屏幕并不是故意大于他们想要打开的任何单个窗口的大窗口,而且你也确定他们想要你的b
$ b应用程序占用整个屏幕。


大多数浏览器用户都知道如何让他们的窗户填满屏幕

如果这是他们选择做的事情。

-

The first thing to consider is whether resizing a window is, itself,
compliant with current best practices. I believe that''s a "no".

It''s probably acceptable in some intranet applications, where you''re
sure that the user''s screen isn''t intentionally larger than any
single window they would ever want to open, and where you''re also
sure that they want your application to take up their entire screen.

Most browser users know how to make their windows fill the screen
if that''s what they choose to do.
--


好吧,假设哲学问题已经解决,

技术问题是什么?

Well, assuming that the philosophical issues have been sorted out,
what of the technical ones?


" nitrospectide"询问
"nitrospectide" asks

好​​吧,假设哲学问题已经分类了

out,那些技术问题是什么?
Well, assuming that the philosophical issues have been sorted
out, what of the technical ones?



这是不可能回答的。假设2 + 2 = 5,那么1 + 1多少钱? (并且

不要说这取决于老大哥想要什么,我们不再生活在1984年

了,这不是政治问题,而只是一个数学问题。)

意思是前面给出的答案的话,应该告诉你

的东西。

hth

Yorick
http://www.yorick.onlyfools.com/


这篇关于Dom遵守的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆