javascript框架_选择JavaScript框架的8个注意事项

javascript框架

Picking your JavaScript framework is a difficult decision. There are many considerations that need to be made when choosing which JavaScript framework is best for you. These are the considerations I judge each JavaScript framework by before committing to it for a project (or all of them).

选择您JavaScript框架是一个艰难的决定。 选择最适合您JavaScript框架时,需要考虑许多因素。 这些是我在为项目(或所有项目)提交之前要判断每个JavaScript框架的考虑因素。

它能满足您的需求吗? (Does it do what YOU need it to?)

This may seem obvious but there's always a temptation to fall in love with the cool features of a JavaScript framework before confirming that the framework provides the functionality needed for the upcoming project. Have a list of functionality you need and stick to it.

这似乎很明显,但是在确认该框架提供了即将到来的项目所需的功能之前,总是有一种爱上JavaScript框架的酷功能的诱惑。 列出所需的功能并坚持使用。

代码有多快? (How fast is the code?)

Users expect accuracy, users want speed. No matter how cool your design, content, or JavaScript effect may be, if your website is slow, your user is gone. You will need for the basic functions to be as fast as possible so that your own code can run quickly. Don't know how fast each framework is? You can always see the most up to date versions of each framework run at the MooTools Slickspeed page. Run at least five tests before concluding which is faster.

用户期望准确性,用户希望速度。 无论您的设计,内容或JavaScript效果多么酷,如果您的网站运行缓慢,那么您的用户就不见了。 您需要使基本功能尽可能快,以便您自己的代码可以快速运行。 不知道每个框架有多快? 您始终可以在MooTools Slickspeed页面上看到运行的每个框架的最新版本。 在确定哪个更快之前,请至少运行五个测试。

框架有多大(文件大小)? (How large (file size) is the framework?)

It will be important that the file size is small on two fronts: you will want the JavaScript to be a quick download for the user and you will need to worry about bandwidth if your site is popular. There are many tools to compress your JavaScript; I recommend Dean Edwards' Packer.

重要的是,文件的大小在两个方面要小:您希望JavaScript是对用户的快速下载,并且如果您的网站很受欢迎,您将需要担心带宽。 有很多工具可用来压缩JavaScript。 我推荐Dean Edwards的Packer。

有足够的文件吗? (Is there adequate documentation?)

One issue that has plagued JavaScript frameworks for a few years is that they haven't been documented well (if at all). Prototype seemed to be the most used and highly-regarded frameworks a year ago but Prototype offered little documentation. Each framework now provides more documentation, but make sure the documentation is adequate for your purposes.

困扰JavaScript框架几年的一个问题是,对它们的记录还不够好(如果有的话)。 原型似乎是一年前使用最多且备受推崇的框架,但是原型几乎没有提供任何文档。 每个框架现在都提供了更多文档,但是请确保该文档足以满足您的目的。

社区有多活跃? (How active is the community?)

One of the best parts of any free, open source software is the community. The community is extremely important within the JavaScript community. The community provides help, code examples, and suggestions for the framework and others using the framework. Be sure to check out the community before you choose your framework.

社区是任何免费开放源软件中最好的部分之一。 在JavaScript社区中,社区非常重要。 社区为框架和其他使用框架的人员提供帮助,代码示例和建议。 选择框架之前,请务必先查看社区。

代码的模块化程度如何? (How modular is the code?)

Frameworks can often get quite large in file size and its likely that you don't need all of the code. A good framework will keep the code modular so that you can pick which functionalities you need.

框架通常会变得非常大,并且文件可能不需要所有代码。 一个好的框架将使代码保持模块化,以便您可以选择所需的功能。

哪些专业网站使用该框架? (Which professional websites use the framework?)

A few of the frameworks are being used by some recognizable websites and business. For example, Digg and Apple use Prototype/Scipt.aclo.us, cNet and GameSpot use MooTools, and WordPress uses jQuery. Big company support can show the maturity of a framework.

一些知名网站和企业正在使用一些框架。 例如,Digg和Apple使用Prototype / Scipt.aclo.us,cNet和GameSpot使用MooTools,而WordPress使用jQuery。 大公司的支持可以显示框架的成熟度。

它可以为您节省多少时间(代码可以保留多长时间)? (How much time does it save you (how short can the code be)?)

A major benefit to using a JavaScript framework is that they provide code structures to allow you to do what every programmer would love: code less, do more. Look for your framework to allow you to chain functionality to allow maximum functionality with as little code as possible.

使用JavaScript框架的主要好处是它们提供了代码结构,使您可以做每个程序员都想做的事情: 减少代码编写,做更多事情 。 寻找您的框架以允许您链接功能,以使用尽可能少的代码获得最大的功能。

翻译自: https://davidwalsh.name/javascript-framework-considerations

javascript框架

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
抱歉,我是一名语言模型,无法提供代码,但可以给你一些指导。 以下是一些基本的步骤和注意事项: 1. 首先,你需要下载并引入Bootstrap框架的CSS和JS文件。 2. 在HTML中添加一个表单,包含用户名、密码、邮箱等注册信息的输入框。 3. 使用Bootstrap的表单组件来美化这些输入框。 4. 添加一个提交按钮,使用Bootstrap的按钮组件来美化它。 5. 写一些JavaScript代码来验证用户输入的信息,例如确保用户名和密码都不为空,邮箱格式正确等。你可以使用Bootstrap的表单验证插件来简化这个过程。 6. 当用户点击提交按钮时,向服务器发送一个POST请求,将注册信息传递给后端处理。 7. 在服务器端处理注册请求,将用户信息写入数据库中,并发送邮件进行验证等操作。 8. 如果一切顺利,跳转到登录页面或者提示用户注册成功。 注意事项: 1. Bootstrap的CSS和JS文件需要在HTML中正确引用。 2. 在表单中使用Bootstrap的组件时,需要遵循它们的命名规则和HTML结构。 3. 如果使用Bootstrap的表单验证插件,需要在表单上添加相应的属性和样式,以及写一些JavaScript代码来处理验证结果。 4. 在提交表单时,需要防止用户的输入被篡改或者伪造,可以使用一些技术手段(例如CSRF token)来增加安全性。 5. 在服务器端处理注册请求时,需要注意输入数据的合法性和安全性,例如防止SQL注入等攻击。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值