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
WBOYOriginal
2016-09-14 09:41:281178browse

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?

  • 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