验证者不喜欢我的javascript可以帮助我吗? [英] Validator doesnt like my javascript can some help me?

查看:66
本文介绍了验证者不喜欢我的javascript可以帮助我吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿大家,


我有这个浏览器检测脚本,验证器遇到问题

it,我试图验证XHTML 1.0的页面过渡性


如果您有任何想法或建议,他们会非常明确

这是脚本和验证员吐出的错误


< script language =" JavaScript" type =" text / javascript">

功能按钮()

{

if((navigator.appName ==" Microsoft)互联网

资源管理器"&&(parseInt(navigator.appVersion)> = 4)){

document.write(''< input type =" ; button" onclick =" ClipBoard();" value ="复制"

/>'');

}其他{

document.write("");

}

}

< / script>


1 ..第14行,第55栏:字符&是

分隔符的第一个字符,但是作为数据出现


... pName ==" Microsoft Internet

Explorer" ;)&&(parseInt(navigator.appVersion)> = 4)){


如果您希望包含<"你的输出中的字符,你应该逃避

为& lt;。另一种可能性是您忘记在

之前的标记中关闭引号。


2 ..第14行,第56列:字符&是

分隔符的第一个字符,但是作为数据出现


if((navigator.appName ==" Microsoft Internet

Explorer")&&(parseInt(navigator.appVersion)> = 4)){


3 ..第15行,第75列:文档类型不允许元素 ;输入"这里


...吨"的onclick = QUOT;剪贴板();"值= QUOT;复制和QUOT; />'');


上面提到的元素是在不允许的上下文中找到的。

这可能意味着你有错误的嵌套元素 - 例如

" style" 身体中的元素部分而不是内部头部 - 或两个

元素重叠(不允许)。


此错误的一个常见原因是在HTML中使用XHTML语法

文件。由于HTML的隐式封闭元素的规则,这个错误可以

创建级联效果。例如,使用XHTML''自关闭'。标签

formeta和链接在头部中HTML文档的一部分可能导致

解析器推断出head的结尾。部分和

身体的开头部分section(不允许使用link和meta;因此报告的

错误)。

Hey everyone,

I have this browser detect script and the validator is having problems with
it, im trying to validate a page for XHTML 1.0 Transitional

If you have any ideas or suggestions they would be greatly appericated
Here is the script and the error that validtor spits out

<script language="JavaScript" type="text/javascript">
function button()
{
if ((navigator.appName=="Microsoft Internet
Explorer")&&(parseInt(navigator.appVersion)>=4)) {
document.write(''<input type="button" onclick="ClipBoard();" value="Copy"
/>'');
} else {
document.write("");
}
}
</script>

1.. Line 14, column 55: character "&" is the first character of a
delimiter but occurred as data

...pName=="Microsoft Internet
Explorer")&&(parseInt(navigator.appVersion)>=4)) {

If you wish to include the "<" character in your output, you should escape
it as "&lt;". Another possibility is that you forgot to close quotes in a
previous tag.

2.. Line 14, column 56: character "&" is the first character of a
delimiter but occurred as data

if ((navigator.appName=="Microsoft Internet
Explorer")&&(parseInt(navigator.appVersion)>=4)) {

3.. Line 15, column 75: document type does not allow element "input" here

...ton" onclick="ClipBoard();" value="Copy" />'');

The element named above was found in a context where it is not allowed.
This could mean that you have incorrectly nested elements -- such as a
"style" element in the "body" section instead of inside "head" -- or two
elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML
documents. Due to HTML''s rules of implicitly closed elements, this error can
create cascading effects. For instance, using XHTML''s "self-closing" tags
for "meta" and "link" in the "head" section of a HTML document may cause the
parser to infer the end of the "head" section and the beginning of the
"body" section (where "link" and "meta" are not allowed; hence the reported
error).

推荐答案

Sheperd写道:
Sheperd wrote:
我有这个浏览器检测脚本和验证器有问题
,我试图验证页面的XHTML 1.0 Transitional
I have this browser detect script and the validator is having problems
with it, im trying to validate a page for XHTML 1.0 Transitional

<

http://www.w3。 org / TR / xhtml1 /#h-4.8
http: //www.hixie.ch/advocacy/xhtml

-

David Dorward< http://blog.dorward.me .UK /> < http://dorward.me.uk/>

Home是〜/ .bashrc的地方



http://www.w3.org/TR/xhtml1/#h-4.8
http://www.hixie.ch/advocacy/xhtml

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is


Sheperd写道:
Sheperd wrote:
我有这个浏览器检测脚本和
I have this browser detect script and




你为什么试图检测浏览器?

-

Brian(删除.invalid给我发电子邮件)



Why are you trying to detect the browser?

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/


Sheperd写道:
Sheperd wrote:
大家好,

我有这个浏览器检测脚本,验证器有问题,我试图验证XHTML 1.0 Transitional的页面

如果您有任何想法或建议,他们将会非常谨慎

这是脚本和验证员吐出的错误

< script language =" JavaScript" type =" text / javascript">
功能按钮()
{
if((navigator.appName ==" Microsoft Internet
Explorer")&& (parseInt(navigator.appVersion)> = 4)){
document.write(''< input type =" button" onclick =" ClipBoard();" value =" Copy"
/>'');
} else {
document.write("");
}
}
< / script>

1 ..第14行,第55栏:字符&是
分隔符的第一个字符,但是作为数据出现

... pName ==" Microsoft Internet
Explorer")&&(parseInt(navigator.appVersion) )> = 4)){

如果您希望包含<"输出中的字符,您应该将其转义为& lt;。另一种可能性是你忘了在
上一个标签中关闭引号。

2 ..第14行,第56列:字符&是
分隔符的第一个字符,但是作为数据出现

if((navigator.appName ==" Microsoft Internet
Explorer")&&(parseInt(navigator) .appVersion)> = 4)){

3 ..第15行,第75列:文档类型不允许元素输入这里

...吨的onclick = QUOT;剪贴板();"值= QUOT;复制和QUOT; />'');

上面提到的元素是在不允许的上下文中找到的。
这可能意味着你有错误的嵌套元素 - 比如
风格 身体中的元素部分而不是内部头部 - 或两个重叠的元素(不允许)。

这个错误的一个常见原因是在HTML
文档中使用XHTML语法。由于HTML的隐式封闭元素规则,此错误可以创建级联效果。例如,使用XHTML''自关闭'。标签
formeta和链接在头部中HTML文档的一部分可能导致
解析器推断出head的结尾。部分和
身体的开头。 section(其中link和meta不允许;因此报告的
错误)。
Hey everyone,

I have this browser detect script and the validator is having problems with
it, im trying to validate a page for XHTML 1.0 Transitional

If you have any ideas or suggestions they would be greatly appericated
Here is the script and the error that validtor spits out

<script language="JavaScript" type="text/javascript">
function button()
{
if ((navigator.appName=="Microsoft Internet
Explorer")&&(parseInt(navigator.appVersion)>=4)) {
document.write(''<input type="button" onclick="ClipBoard();" value="Copy"
/>'');
} else {
document.write("");
}
}
</script>

1.. Line 14, column 55: character "&" is the first character of a
delimiter but occurred as data

...pName=="Microsoft Internet
Explorer")&&(parseInt(navigator.appVersion)>=4)) {

If you wish to include the "<" character in your output, you should escape
it as "&lt;". Another possibility is that you forgot to close quotes in a
previous tag.

2.. Line 14, column 56: character "&" is the first character of a
delimiter but occurred as data

if ((navigator.appName=="Microsoft Internet
Explorer")&&(parseInt(navigator.appVersion)>=4)) {

3.. Line 15, column 75: document type does not allow element "input" here

...ton" onclick="ClipBoard();" value="Copy" />'');

The element named above was found in a context where it is not allowed.
This could mean that you have incorrectly nested elements -- such as a
"style" element in the "body" section instead of inside "head" -- or two
elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML
documents. Due to HTML''s rules of implicitly closed elements, this error can
create cascading effects. For instance, using XHTML''s "self-closing" tags
for "meta" and "link" in the "head" section of a HTML document may cause the
parser to infer the end of the "head" section and the beginning of the
"body" section (where "link" and "meta" are not allowed; hence the reported
error).




你是并不孤单。


他们的* HTML验证器也讨厌雅虎的Geocities javascript广告盒。

我的HTML有效4.01过渡,但雅虎''广告在我的主页上产生21个错误




You''re not alone.

Their *HTML validator hates Yahoo''s Geocities javascript Ad Boxes, too.
My HTML is valid 4.01 Transitional, but Yahoo''s ads generate 21 errors
on my home page!


这篇关于验证者不喜欢我的javascript可以帮助我吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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