Home > Backend Development > PHP Tutorial > javascript - When php creates the default selected state of the menu, which one is faster, php regular or jq loop?

javascript - When php creates the default selected state of the menu, which one is faster, php regular or jq loop?

WBOY
Release: 2016-09-14 09:41:28
Original
1180 people have browsed it

For example, if the menu is of ul li structure

  • means selected, is it faster to use php regular url to add active, or is it faster to use jq to traverse all li under ul? There are multiple uls , actually a level 3 menu

    Reply content:

    For example, the menu is of ul li structure

  • means selected. Is it faster to use php regular url to add active or jq to traverse all li under ul? There are multiple uls. , actually a level 3 menu

    jq processing will be faster. If your menu is controlled by the background, you can judge the default selected status in the background.

    Isn’t regular expression the least efficient?

  • Related labels:
    source:php.cn
    Statement of this Website
    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
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template