Home>Article>Web Front-end> Can jquery be used on the mobile terminal?

Can jquery be used on the mobile terminal?

WBOY
WBOY Original
2022-09-07 16:34:12 2130browse

Mobile terminal development can use jquery, but it is not recommended; it is not recommended because jquery blocks the differences between browsers, and there is no problem of different APIs supported by different browsers, and now various front-end Frameworks greatly facilitate front-end program development, and most of these frameworks do not encourage direct manipulation of the DOM.

Can jquery be used on the mobile terminal?

The operating environment of this article: Windows 10 system, jquery version 3.6.0, Dell G3 computer.

Can the mobile terminal use jquery?

First of all, it should be noted that jQuery can be used to develop mobile web pages, but it is not recommended!

I don’t recommend using jQuery anymore. I think there are at least two reasons.

  • Firstly, jQuery has a feature, which is also an advantage that people talk about.It is that jQuery blocks the differences between browsers.

But the starting point of this feature is that some PC browsers do not support the JavaScript standard API, such as IE. The actual situation is that a lot of jQuery code is Make up for the trouble caused by IE. This has caused jQuery to be particularly bloated, especially when the mobile terminal has relatively high requirements for traffic and page opening speed. This original advantage has turned into a disadvantage.

Moreover, there is no unique mobile browser like IE. Most (basically all) browsers are based on webkit core or blink core and all support standards. H5 api, so there is no problem of different apis supported by different browsers. In this way, it becomes more and more highlighted that jQuery's efforts in unifying the api are bloated and meaningless, at least in the mobile web This is the case.

  • The second is that front-end development has gone through a process. Simply put, it is: native js → js library (jQuery, etc.) → front-end framework (Angular, Vue, etc.). The reason for such a change process is simply to liberate programmers and achieve the purpose of developing projects more quickly. This is in line with the changes in back-end development technology.

Nowadays, various front-end frameworks have greatly facilitated front-end program development, and most of these frameworks do not encourage direct manipulation of the DOM, such as Vue, through data binding The specific mechanism basically does not require manipulation of the DOM. In this case, we have all begun to use these frameworks and do not need to operate the DOM. Why do we still cling to jQuery?

Therefore, it is not recommended to use jQuery when developing mobile web.

Related tutorial recommendations:jQuery video tutorial

The above is the detailed content of Can jquery be used on the mobile terminal?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn