在参数列表后丢失) [英] missing ) after argument list

查看:81
本文介绍了在参数列表后丢失)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么Firefox会抱怨这个错误:


--------------------------- ---------------------------------
缺少
)参数列表后


setTimeout(''breakOut'',5000);

----------------------- -------------------------------------


这里是我正在制作的HTML:


< html>

< head>

<脚本类型=" text / javascript">

<! -

function breakOut(){

top.location.href =' 'https://foo.com';

}

// - >

< / script>

< body onLoad =" setTimeout(''breakOut()'',5 ???);">

您已经退出控制面板暂停

你的安全。

< / body>

< / html>

解决方案

ma ********** @G mail.com 写道:

为什么Firefox抱怨这个错误:

------------- -----------------------------------------------
缺少)参数列表之后

setTimeout(''breakOut'',5000);
--------------------- ---------------------------------------

这是我正在制作的HTML:

< html>
< head>


< URL:http://validator.w3.org/>

< script type =" text / javascript">
<! -
^^^^

不必要且可能有害。

函数breakOut(){
top.location。 href =''https://foo.com'';


top.location =''https://foo.com/'';


足够且不容易出现同源政策。

}
// - >
^^^^^^

不必要。

< / script>
< body onLoad =" setTimeout(''breakOut( ) '',5 ???);">
^^^

这不是零('0'')字符。 ---''

[...]



PointedEars


有效!


为什么<! - // - >认为有害吗?他们不应该帮助

JS-crippled浏览器降级了?


- Mark


blockquote>

ma**********@gmail.com 说以下是2005年12月14日下午12:55:

这有效!

为什么<! - // - >认为有害吗?他们不应该帮助JS浏览器瘫痪的浏览器降级吗?




它们在HTML文档中没有害处。他们根本不需要

全部。没有现代浏览器不理解脚本标签

以及在没有脚本的情况下如何处理它。是否由于禁用或缺乏脚本支持而导致缺席



-

Randy
comp.lang.javascript常见问题 - http://jibbering.com/faq&新闻组每周

Javascript最佳实践 - http://www.JavascriptToolbox .com / bestpractices /


Why is Firefox complaining with this error:

------------------------------------------------------------
missing ) after argument list

setTimeout(''breakOut'',5000);
------------------------------------------------------------

Here is the HTML that I''m producing:

<html>
<head>
<script type="text/javascript">
<!--
function breakOut() {
top.location.href = ''https://foo.com'';
}
// -->
</script>
<body onLoad="setTimeout(''breakOut()'',5???);">
You have been logged out of the control panel due to inactivity for
your security.
</body>
</html>

解决方案

ma**********@gmail.com wrote:

Why is Firefox complaining with this error:

------------------------------------------------------------
missing ) after argument list

setTimeout(''breakOut'',5000);
------------------------------------------------------------

Here is the HTML that I''m producing:

<html>
<head>
<URL:http://validator.w3.org/>
<script type="text/javascript">
<!-- ^^^^
Unnecessary and potentially harmful.
function breakOut() {
top.location.href = ''https://foo.com'';
top.location = ''https://foo.com/'';

is sufficient and not prone to the Same Origin Policy.
}
// --> ^^^^^^
Unnecessary.
</script>
<body onLoad="setTimeout(''breakOut()'',5???);"> ^^^
This is not the zero (''0'') character. ---''
[...]


PointedEars


That worked!

Why are the <!-- //--> considered harmful? Aren''t they supposed to help
JS-crippled browsers degrade?

- Mark


ma**********@gmail.com said the following on 12/14/2005 12:55 PM:

That worked!

Why are the <!-- //--> considered harmful? Aren''t they supposed to help
JS-crippled browsers degrade?



They aren''t harmful in an HTML document. They simply aren''t needed is
all. There are no modern browsers that do not understand the script tag
and what to do with it in the absence of script. Whether that absence is
caused by disabling or the lack of script support at all.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


这篇关于在参数列表后丢失)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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