没有JavaScript的DOM操作 [英] DOM manipulation without JavaScript

查看:160
本文介绍了没有JavaScript的DOM操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用客户端DOM操作时,我们通常使用JavaScript或jQuery。我想知道如果没有JavaScript或者JavaScript的库,是否还有其他方法呢?

When working on client-side DOM manipulation, we usually use JavaScript or jQuery. I am wondering if there is any other way to do this without JavaScript or JavaScript-based libraries?

推荐答案

没有其他真正的跨浏览器脚本语言比Javascript。
JQuery是一种编程语言,只是一个库,可以帮助提取浏览器的JavaScript API差异。

There is no other real cross-browser scripting language than Javascript. JQuery is NOT a programming language, just a library that help abstracting the browser's differences in their javascript API.

浏览器供应商它的时间试图提出不太好的替代品。主要原因是用其他东西替换javascript将需要所有浏览器来支持它,这不会很快发生(或者更有可能不会发生)。

Browser vendor at its time tried to propose alternatives that were not well received. The main reason being that replacing javascript with something else would need all browsers to support it, which is not going to happen anytime soon (or more likely, not going to happen at all).


  • 互联网浏览器支持年龄的VBscript(高达IE 10)

  • 一个特殊的Chrome版本(dartium)本身支持Dart编程语言。

现在,这并不意味着您需要在javascript中编写客户端交互性代码。
您可以随时使用一种语言进行编码,并编译成javascript。

Now, that does not mean that you need to code in javascript for client side interactivity. You can always code in one language, and compile to javascript.

仅举几例


  • 可以使用emscriptem将C / C ++编译为Javascript

  • 可以使用Google Web Toolkit将Java编译为JS

  • Dart还可以通过捆绑的编译器编译成javascript

  • Haxe可以通过捆绑编译器编译成javascript,PHP,ActionScript等。

  • CoffeeScript,TypeScript,JSX都是要编译成javascript的。

  • 还有更多!

  • C/C++ can be compiled to Javascript with emscriptem
  • Java can be compiled to JS with Google Web Toolkit
  • Dart can also be compiled to javascript with bundled compiler
  • Haxe can be compiled to either javascript, PHP, ActionScript, ... with bundled compiler.
  • CoffeeScript, TypeScript, JSX are all meant to be compiled to javascript.
  • There are more!

这篇关于没有JavaScript的DOM操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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