浏览器供应商是否支持除

之外的任何脚本语言

  • text/javascript
  • text/vbscript(仅限)

例如:

  • text/lua
  • text/cs-script
  • text/php
  • text/tcl

如果我想在浏览器中使用其他脚本语言:

<SCRIPT type="text/javascript">
   ...some JavaScript...
</SCRIPT>

<SCRIPT type="text/vbscript">
   ...some vbscript...
</SCRIPT>

<SCRIPT type="text/perl">
   ...some Perl Script...
</SCRIPT>

<SCRIPT type="text/php">
   ...some Php...
</SCRIPT>

<SCRIPT type="text/tcl">
   ...some Tcl...
</SCRIPT>

<SCRIPT type="text/lua">
   ...some Lua...
</SCRIPT>

<SCRIPT type="text/pascalscript">
   ...some PascalScript...
</SCRIPT>

<SCRIPT type="text/cs">
   ...some C#...
</SCRIPT>
. 我可以吗?

有没有办法使用任何浏览器注册第三方脚本发动机?

有帮助吗?

解决方案

技术上,Internet Explorer CAN 使用提供 IActiveScript 实现,我已经看到了Perl(来自ActiveState)和TCL在IE中运行的TCL的实现。

但是对于Minitech的观点来说,这不是跨越浏览器的东西,坦率地说,几乎所有情况都是一个可怕的想法。

其他提示

no。如果您想使用不同的语言,最好的选择是使用编译成JavaScript的东西(例如Python的睡衣)。

Google Chrome有一个本机代码插件,允许使用您具有正确插件的任何语言。例如,有一个 tcl实现

There are what I consider hack-ish ways to do it which involves some kind of interpreter between the browser and the script language. Two examples of this are using SilverLight to interface with various dynamic languages, or JRuby to interface using Ruby script. Otherwise it has to get compiled to JS.

No, there isn't. Not any portable way, at least, and not anything you should do.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top