Although a week has passed since WeChat officially released Mini Programs , people’s enthusiasm for discussing Mini Programs seems to have not diminished at all. These days, when you open the WeChat public account , you can see articles like "The most complete guide to mini programs" and "How to use mini programs to get rich" everywhere. Indeed, the Internet circle is so small that every small action of WeChat can trigger a small climax. Moreover, product managers seem to be particularly sensitive to WeChat. Even if Guoguo's article mentions the word WeChat in the title, the number of readers will go up a level directly. Don't believe it? Let’s do an AB test next time. Of course, Guoguo did not follow the trend and wrote several technical analysis articles about mini programs. After much analysis, the mini program is nothing more than a highly customized H5 page . WeChat has created its own set of HTML tags, called wxml, and encapsulated some style rules, called wxss. No matter what it is called, it is still the HTML+CSS+JS set in the web front-end. On the one hand, encapsulation is to reduce development costs, and fundamentally it is to centralize control rights. The fewer things developers can use, the less WeChat needs to worry about. Of course, these are not the point. The point is, if you want to create a small program yourself, you can't get around js. Many students left messages in the background, saying how they made up their minds to learn js and how they went from getting started to giving up. Guoguo was very sad to hear this. When Guoguo was in school, there were two paths in front of him, learning JS or learning Java. Guoguo chose Java without hesitation. The reason is, js is so simple, what can it do? Now think about it, it is really a pattern. It is precisely because of its simplicity that it has a mass base. No matter how pure your Java or C++ is, or how versatile you are, they will eventually be submerged in the vast ocean of the masses. Is js really simple? Really, simple. For example, there are only 5 simple data types in js: undefined, null, Boolean, Number and String. Don’t look at the first two, they mean non-existence (in computers, non-existent things are also a kind of thing, called “non-existent things”). The last three, Boolean can represent true or false, right or wrong, right or wrong, do you love me or not, etc., which have only two values; Number represents numbers such as 1024; and String represents a word or a sentence. That’s it, the whole world is under your control. In contrast, in C language, short, char, int, and long can all represent an integer, my God. There are also pointers that I can't understand no matter how hard I try. I once suspected that it was because of this that the male to female ratio in our major is 7 to 1. What’s even more disgusting is that a pointer can actually represent an integer. In addition to simple data, js also has simple syntax. There are two sets of statements commonly used: if...else and for... The others are advanced grammars, used for showing off. Functions look the same as in C language, except that they have an additional prefix called "function". You can travel the world if you use it skillfully. Later, js learned objects from java, and simplified everything from object definition to object creation. There are three commonly used ones, Array, Date and RegExp, which represent data collection, date and regular expression respectively. JS also supports object-oriented things, inheritance and encapsulation, but the old version of JS is a bit complicated to implement. The current ES6 standard has simplified it a lot. Once you have mastered the basic types, basic syntax, functions, and objects, you can say that it will take no more than two days to get started with JS. However, if you can't wait to argue with the programmer at this time, you will definitely be despised. They will very confidently throw out two concepts that tortured them during the interview, prototype and closure, to you, in order to persuade you to give up when you see difficulty. What are prototypes and closures? Please search on Baidu yourself. I don’t think I can explain it clearly. For these things, it's absolutely not enough to just memorize the concepts. Wait until you need them and then look them up. Once you understand them, you will understand them. At this point, you should be able to handle things at the js language level. Then you need to learn various APIs. What API? js runs in the browser , and the first thing to do is of course the API provided by the browser. These APIs include all aspects of the capabilities provided by the browser, such as opening and closing windows, forward and backward history, etc. Most of them are placed in a global object called window. Just open a web page, press F12, and enter window in the console, and you will find that this thing is really large and comprehensive. There are also some APIs that are used to manipulate the structure of the page. The simplest example is to switch to DOM when no data is pulled, and replace it with real data after the data is pulled. The change of interface elements can also be completed through js, which is called DOM operation. Of course, you also need to learn the API of the mini program. WeChat itself provides many capabilities that are only available on terminals, such as sensors, opening files, etc. In the past, it was done through js bridge, which is actually the same principle. If you want to understand the operation process of the mini program, there is a concept you must master: "event". Events are very common in programs. We also live in a world full of events. If you are interested in an event but it has not happened yet, such as the US liberating North Korea, you can subscribe first, and when the event is triggered, let others give you a notification, giving you a chance to execute your own code. In the mini program, events include the APP being opened, the APP being pushed to the background, and the APP coming back. When such an event occurs, you have the opportunity and must do something, otherwise you won’t know how the program bug occurred. Summarizejs itself is very simple. However, I always feel that if you come into contact with something new, from a language to an industry, from entering the industry to getting started, you must spend enough time on it, no matter whether you are a genius or not, and no matter how efficient you are. It takes 21 days to get started with C++, but only one week is enough to learn JS. You might as well pick any idea that can change the world but only needs a programmer, and turn it into a small program. You will know how many bumps there are on the road once you go through it. Mobile application product promotion service: APP promotion service Qinggua Media advertising This article was compiled and published by @Talking Technology to Product Managers (Qinggua Media). Please indicate the author information and source when reprinting! |
<<: How much does it cost to customize a catering mini program in Hezhou?
>>: Introduction to Dong Zhongshu: How to increase the amount of external links?
The low conversion rate of SEM promotion is a com...
As a marketer , we must always pay attention to t...
Dynamic product ads can be precisely delivered ba...
Where can I buy real fans on Douyin ? Contact inf...
Current PC search brand ads have the following pr...
In order to write this article well, I have been ...
On May 17, WeChat iOS users updated to version 6....
The changes of the times and channels will bring ...
In the tenth year of Double 11, more e-commerce c...
For experienced netizens, they can almost see thr...
There is nothing wrong with chasing hot topics , ...
In the cosmetics category, there are two phenomen...
Search engine mechanism 1. Search mechanism As a ...
Tik Tok has started to associate videos and produ...
Member points systems are very common in today...