Home  >  Article  >  Web Front-end  >  How to use front-end Js framework

How to use front-end Js framework

php中世界最好的语言
php中世界最好的语言Original
2018-06-04 18:02:563502browse

This time I will show you how to use the front-end Js framework and what are the precautions when using the front-end Js framework. The following is a practical case, let's take a look.

Overview:

 Some days I can’t sit down and write a blog. In the era of rapid development of the Internet, the speed of technological updates and iterations is also increasing. accelerate. I feel envious when I see Java, Js, and Swift flourishing in various fields. The news about .net is also exciting, including .net core 1, mono, xamarin, etc., but most of them are still in the roaring stage. In fact, the understanding of technology has always been that technology serves business and products, and products promote the evolution of technology to varying degrees.

Web, wireless, Internet of Things, VR, and PC are promoting technological integration and micro-innovation from different directions. The role of programmers in different business scenarios is reversed. With the emergence of node.js, the role of language is also changing, and JS plays an increasingly important role. I also sorted out the knowledge I learned after dinner. After reading "Your Knowledge Needs Management", I strongly realized that a messy and extensive knowledge reserve is far less beneficial than organized and organized knowledge. So, yes, we need to come back from time to time to sort out the knowledge we have in order to prepare for emergencies.

1. Front-end framework library:

1.Zepto.js

  • Description: Zepto is a lightweight JavaScript library for modern advanced browsers. It has a similar API to jquery. If you can use jquery, then you can also use zepto. I also learned about Zepto through chatting with a Tencent friend, and only had some basic understanding.

2.SUI Mobile

  • ##Description: SUI Mobile is developed based on Framework7 UI library. It is very lightweight and beautiful. You only need to introduce our CDN file to use it. It is compatible with iOS 6.0 and Android 4.0, making it very suitable for developing cross-platform Web Apps.

  • Usage: You have also seen that it is used for the development of Web App on the wireless side.

3.Node.Js

  • ##Description: Node .js is a Javascript runtime. In fact, it encapsulates the Google V8 engine. The V8 engine executes Javascript very quickly and has very good performance. Node.js optimizes some special use cases and provides alternative APIs to make V8 run better in non-browser environments.

Node.js is a platform built on the Chrome JavaScript runtime, which is used to easily build web applications that respond quickly and are easy to expand. Node.js uses an event-driven, non-blocking I/O model to be lightweight and efficient, making it ideal for running data-intensive real-time applications on distributed devices.

Simply put, Node.js is JavaScript running on the server side.

Node.js is a platform built on the Chrome JavaScript runtime.

Node.js is an event-driven I/O server-side JavaScript environment based on Google's V8 engine. The V8 engine executes Javascript very quickly and has very good performance.

  • Usage:

  • ## 1. RESTful API

This is the most ideal application scenario for NodeJS. It can handle tens of thousands of connections. It does not have much logic. It only needs to request the API and organize the data to return. It essentially just looks up some values ​​from some database and composes them into a response. Since responses are small amounts of text and inbound requests are small amounts of text, the traffic is not high and a single machine can handle the API needs of even the busiest companies.

2. Unify the UI layer of Web applications

The current MVC architecture, in a sense, has two UIs for Web development Layers, one is what we finally see in the browser, and the other is on the server side, responsible for generating and splicing pages.

I won’t discuss whether this architecture is good or bad, but there is another practice, the service-oriented architecture, which can better separate the dependencies of the front and back ends. If all key business logic is encapsulated into REST calls, it means that the upper layer only needs to consider how to use these REST interfaces to build specific applications. Those back-end programmers don't have to worry about how specific data is passed from one page to another. They don't have to worry about whether user data updates are obtained asynchronously through Ajax or by refreshing the page.

 3. Applications with a large number of Ajax requests

For example, personalized applications, each user will see a different page, and the cache will be invalid. Ajax requests need to be initiated when the page is loaded, and NodeJS can respond to a large number of concurrent requests. In short, NodeJS is suitable for use in scenarios with high concurrency, I/O intensive, and a small amount of business logic.

4.angular.Js

  • ##Description: AngularJS[1] Born in 2009 It was founded by Misko Hevery and others in 2006, and was later acquired by Google. It is an excellent front-end JS framework that has been used in many Google products. AngularJS has many features, the most core ones are: MVVM, Modularization, automated two-way data binding, semantic tags, Dependency Injection and so on.

  • Usage: We should be able to understand the real purpose of AngularJS very well through the description, MVVM, modularization, automated two-way data Binding and so on. In addition to simple DOM operations, it also reflects the power of Js programming. Of course the application should depend on the occasion.

5.JQuery Mobile

  • ##Description: Query Mobile is jQuery on mobile phones and Version on tablet devices. jQuery Mobile will not only bring the jQuery core library to mainstream mobile platforms, but also release a complete and unified jQuery mobile UI framework. Supports global mainstream mobile platforms. The jQuery Mobile development team said: We are very excited to develop this project. The mobile Web needs a cross-browser framework to allow developers to develop truly mobile Web sites.

  • Purpose: jQuery Mobile is a framework for creating mobile web applications.

jQuery Mobile works on all popular smartphones and tablets.

jQuery Mobile uses HTML5 and CSS3 to lay out pages with as few scripts as possible.

6.requirejs

  • ##Description: The goal of RequireJS is to encourage modularization of code , which uses a different script loading step than the traditional