Java和JavaScript有什么区别 [英] What is the difference between Java and JavaScript

查看:99
本文介绍了Java和JavaScript有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Java和JavaScript有什么区别?您也可以在网页中使用普通Java编程,还是只能使用JavaScript?

What is the difference between Java and JavaScript? Also can you use plain Java programming within webpages or can JavaScript only be used?

推荐答案

@neogazz


我学到了。 Java是面向对象的编程,Javascript用于构建更复杂的网页(没有尝试在网页中使用java脚本)。


你不能在网页中使用JAVA,但你可以使用JAVA Applets并将其嵌入网页。您可以在java中创建JAVA Applet,并将其嵌入到网页中。
@neogazz
Well as I learned. Java is object oriented programming, and Javascript is used to build more complex webpages (haven''t tried using java script in webpages).

You cannot use JAVA in webpages, but you can use JAVA Applets and embed it on web pages. You create JAVA Applets in java, and embed it in web pages.


非常感谢!


for JavaScript无需插件或JVM ...任何现代浏览器都支持开箱即用的JavaScript ......尽管IE的实现存在差异,因为它使用自己的ECMA脚本实现JScript,因此IE大多与其他浏览器不同。用户可能在浏览器中禁用了JavaScript ...因此代码可能无法运行...因此,如果您想依赖它,则需要回退。 JavaScript允许您使用AJAX创建现代和类似桌面的网页......这种技术基本上允许您向服务器发出异步请求,并使用DOM方法更新网页的小部分或更大部分。有很多Libs /框架提供网格,树木等小部件,并为它们提供动画/效果。更喜欢使用JavaScript而不是任何其他需要插件的技术......因为插件需要安装,而JavaScript则不需要。今天唯一不能用JavaScript做的真正的事情就是创建图像/图表......而当浏览器将来使用HTML 5支持画布时,即使这一点也会变得不那么重要。
for JavaScript no plugin or JVM is needed ... any modern browser supports JavaScript out of the box ... even though there are differences in the implementation where IE mostly differs from all others since it uses its own ECMA script implementation JScript. The user might have disabled JavaScript in the browser ... so it could be that the code wouldn''t run ... so in case you want to rely on it you would need a fallback. JavaScript allows you to create modern and desktop-like webpages today by using AJAX ... a technique that basically allows you to make asynchronous requests to the server and to update small or bigger parts of a webpage by using DOM methods. There are a lot of Libs/frameworks out there that provide widgets like grids, trees and provide animation/effects for them. It is much to prefer to use JavaScript instead of any other plugin-requiring techniques ... since a plugin requires an installation while JavaScript doesn''t. The only real thing that cannot be done well with JavaScript today is to create images/charts ... while even this point will become less important when browsers will support canvas in the future with HTML 5.


这篇关于Java和JavaScript有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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