RFD:如何识别错误的Javascript代码 [英] RFD: How To Recognize Bad Javascript Code
问题描述
(征求讨论)
我已经整理了一个指南,我希望这将有助于新手编码器避免
同样的头发拉我经过了。
我很乐意发表评论。
我是否错过了一两点的标记? />
我忽略了什么吗?
我的基本目标有缺陷吗?代码是不是以这么多不同的方式,我只需要打包店而忘记这个?
或者我做了一个粉碎的爆炸工作那个将让新编码员远离大多数在线例子的恐怖,最后结束clj最喜欢的
爱好?(*)
>
(*)说那是垃圾!不要这样做!"
(Request for Discussion)
I''ve put together a guide that I hope will help novice coders avoid the
same hair pulling that I went through.
I''m open for comments about it.
Have I missed the mark on a point or two?
Have I overlooked something?
Is my basic goal flawed? Is code bad in so many different ways that I
should just pack up shop and forget this?
Or did I do a smashing bang-up job that will keep the new coders away from
the horrors of most online examples and finally end c.l.j''s favorite
hobby?(*)
(*) Saying "That''s junk! Don''t do that!"
推荐答案
On Tue,01 Jan 2008 05:28:51 -0500,Jeremy J Starcher写道:
On Tue, 01 Jan 2008 05:28:51 -0500, Jeremy J Starcher wrote:
(讨论请求)
我已经整理了一个指南,希望能帮助新手编程员避免
我经历过的同样的头发拉动。
(Request for Discussion)
I''ve put together a guide that I hope will help novice coders avoid the
same hair pulling that I went through.
如果我包括那将非常有用
< URL: http://www.mopedepot.com/jjs/HowToRe ... criptCode.html >
And it would really help if I included
<URL: http://www.mopedepot.com/jjs/HowToRe...criptCode.html >
1月1日下午6:37,Jeremy J Starcher< r3 ... @ yahoo.spam。 me.not.com>
写道:
On Jan 1, 6:37 pm, Jeremy J Starcher <r3...@yahoo.spam.me.not.com>
wrote:
On Tue,01 Jan 2008 05:28:51 -0500,Jeremy J Starcher写道:
On Tue, 01 Jan 2008 05:28:51 -0500, Jeremy J Starcher wrote:
(讨论请求)
(Request for Discussion)
我已经整理了一个指南,我希望这将有助于新手编码器避免我经历过的同样的头发拉动。
I''ve put together a guide that I hope will help novice coders avoid the
same hair pulling that I went through.
对于language =" javascript"你推荐的问题:
< script type =" text / javascript">< / script>
我个人推荐使用:
< script>< / script>
部分原因是因为text / javascript是一种无效的MIME类型,它应该是
" application / javascript"。但是application / javascript无效
HTML,它必须是text / javascript。所以最好完全避免它和
保存击键/字节。
For the language="javascript" issue you recommended:
<script type="text/javascript"></script>
Personally I''d recommend just using:
<script></script>
Partly because "text/javascript" is an invalid MIME type, it should be
"application/javascript". But "application/javascript" is invalid
HTML, it MUST be "text/javascript". So best to avoid it altogether and
save keystrokes/bytes.
slebetman写道:
slebetman wrote:
1月1日下午6:37,Jeremy J Starcher< r3 ... @ yahoo.spam.me.not.com>
写道:
On Jan 1, 6:37 pm, Jeremy J Starcher <r3...@yahoo.spam.me.not.com>
wrote:
> On Tue,01 Jan 2008 05:28:51 -0500,Jeremy J Starcher写道:
>On Tue, 01 Jan 2008 05:28:51 -0500, Jeremy J Starcher wrote:
>> (请求讨论)
我已经整理了一个指南,我希望这将有助于新手程序员避免我经历的同样的头发拉动。
>>(Request for Discussion)
I''ve put together a guide that I hope will help novice coders avoid the
same hair pulling that I went through.
对于language =" javascript"您推荐的问题:
< script type =" text / javascript">< / script>
For the language="javascript" issue you recommended:
<script type="text/javascript"></script>
哪个是正确的。
Which is correct.
我个人推荐使用:
< script>< / script>
Personally I''d recommend just using:
<script></script>
所以你会推荐无效的标记。
http://validator.w3.org/
部分原因是因为text / javascript是一种无效的MIME类型,
Partly because "text/javascript" is an invalid MIME type,
它不是。
It isn''t.
它应该是应用程序 / JavaScript的" ;.
it should be "application/javascript".
它不应该。
It shouldn''t.
但是application / javascript是无效的HTML,
But "application/javascript" is invalid HTML,
它不是。
It isn''t.
它必须是text / javascript ;。
it MUST be "text/javascript".
它不需要。
It needs not to.
所以最好完全避免它并保存击键/字节。
So best to avoid it altogether and save keystrokes/bytes.
你完全错了:
http://pointedears.de/scripts/test/mime-types/
BTW,我们只讨论过这个几天之前。请在发布前阅读。
PointedEars
-
现实主义:HTML 4.01严格
福音:XHTML 1.0严格
疯狂:XHTML 1.1作为应用程序/ xhtml + xml
- Bjoern Hoehrmann
You are completely wrong:
http://pointedears.de/scripts/test/mime-types/
BTW, we discussed this only a few days ago. Please read before you post.
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
这篇关于RFD:如何识别错误的Javascript代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!