简体   繁体   English

带Rails的JavaScript / Java GWT

[英]JavaScript/Java GWT with Rails

I'm pretty new to web development, so I had some basic questions to get me pointed in the right direction. 我对Web开发还很陌生,因此我有一些基本问题可以使我指出正确的方向。

For the last week I've been learning the rails framework, and from what I understand, this framework is great for building a website, but you still need javascript to build nice front-end interface/apps that run in the browser. 在上周,我一直在学习Rails框架,据我了解,该框架非常适合构建网站,但是您仍然需要JavaScript来构建可在浏览器中运行的漂亮的前端界面/应用。 Is this understanding correct? 这种理解正确吗? If not, why does javascript appear to be so essential to almost al websites? 如果不是,为什么javascript对几乎所有网站都如此重要? In other words, what can you do with js? 换句话说,您可以使用js做什么?

Also, I was wondering if it is necessary for me to learn javascript now that there are tools like GWT that compile Java into js. 另外,我想知道既然有像GWT这样的工具可以将Java编译为js,那么是否有必要学习javascript。 I ask because, I am proficient in Java but have no knowledge when it comes to javascript. 我问是因为,我精通Java,但是不懂JavaScript。 How far can GWT take me before I need to learn javascript, or do I have to learn javascript at all? 在我需要学习JavaScript之前,GWT可以带我走多远?还是必须完全学习JavaScript?

If someone could point me int he right direction by answering these questions, I'd be very grateful. 如果有人可以通过回答这些问题为我指出正确的方向,我将不胜感激。

Thanks 谢谢

GWT compiles Java to JavaScript, but you still will need to learn about web development. GWT将Java编译为JavaScript,但是您仍然需要学习有关Web开发的知识。 I have seen many projects going wrong with GWT because people just started writing Java code and did not care about the underlying platform (the browser) at all. 我已经看到许多GWT项目出了问题,因为人们刚刚开始编写Java代码,根本不关心基础平台(浏览器)。

If you don`t want to care about the browser use some plugin technology (if you are an app inside a controlled environment), otherwise first learn about how to build apps with HTML + JS + CSS. 如果您不想在意浏览器,请使用一些插件技术(如果您是受控环境中的应用程序),否则请先了解如何使用HTML + JS + CSS来构建应用程序。

Eventually you will discover that GWT is a great toolkit for writing fast JavaScript apps in Java, that packs many best practices for building web apps inside the toolkit. 最终,您会发现GWT是用于用Java编写快速JavaScript应用程序的出色工具包,其中包含了许多在工具包中构建Web应用程序的最佳实践。 It has good abstractions, but every abstractions leaks so you will need to have good knowledge of the browser. 它具有良好的抽象性,但是每个抽象性都会泄漏,因此您将需要对浏览器有充分的了解。 You will save on things like keeping away from the bad parts of JavaScript. 您将节省诸如避免JavaScript的不良部分之类的事情。

I'm working with GWT now, and I haven't had to use Javascript at all yet. 我现在正在使用GWT,并且还没有使用Javascript。 I'd say for most websites, GWT should be fine. 我想说,对于大多数网站,GWT应该没问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM