?
<html>
<header>
</header>
<body>
<div class='rebol'>
<pre>
Rebol [
Title: "rebol script embedded in html"
Author-Url: <a href=http://reboltutorial.com/blog/protect-rebol-script-with-php/>http://reboltutorial.com/blog/protect-rebol-script-with-php/</a>
Script-Url: <a href=http://reboltutorial.com/source/rebolscriptembedded.html>http://reboltutorial.com/source/rebolscript.html</a>
Date: 24-Aug-2009
Purpose: {
demo of rebol script embedded in html
}
]
ask "You're successfull!"
</pre>
</div>
</body>
如果在 Rebol 的控制台中进行测试,则会给出
>> do read clipboard://
You're successfull!
== </body>
>>
为什么它会返回以及如何防止这种情况(如果可能)?
<html>
<header>
</header>
<body>
<div class='rebol'>
<pre>
Rebol [
Title: "rebol script embedded in html"
Author-Url: <a href=http://reboltutorial.com/blog/protect-rebol-script-with-php/>http://reboltutorial.com/blog/protect-rebol-script-with-php/</a>
Script-Url: <a href=http://reboltutorial.com/source/rebolscriptembedded.html>http://reboltutorial.com/source/rebolscript.html</a>
Date: 24-Aug-2009
Purpose: {
demo of rebol script embedded in html
}
]
ask "You're successfull!"
</pre>
</div>
</body>
If tested in Rebol's Console this gives
>> do read clipboard://
You're successfull!
== </body>
>>
Why does it return and how to prevent this if possible ?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
首先:REBOL 脚本以
REBOL [...]
标头开始,因此 REBOL 解释器将忽略此标头之前的所有内容。其次:标签是 REBOL 中的有效数据类型。因此,在执行示例脚本时,ask ...
表达式后面还有三个值,最后一个值 () 将返回为你的脚本的结果。
为了防止这种情况,您可以在希望脚本结束的位置添加一个
quit
,即在示例中的ask
表达式之后。First: a REBOL script starts with the
REBOL [...]
header, so everything up to this header will be ignored by the REBOL interpreter. Second: tags are a valid datatype in REBOL. So upon executing your example script, there are three more values following theask ...
expression and the last of those values (</body>
) will be returned as the result of your script.To prevent this, you can add a
quit
where you want your script to end, i.e. after theask
expression in your example.<标题>不是有效的 HTML 标记。你的意思是
<header> is not a valid HTML tag. You mean <head>