What JavaScript library should I use for parsing URL parameters?

前端 未结 8 1587
终归单人心
终归单人心 2020-12-30 09:52

How do I parse URL parameters in JavaScript? (These are the parameters I would ordinarily call GET parameters or CGI parameters, but in this case the page is basically subm

8条回答
  •  悲&欢浪女
    2020-12-30 10:16

    Javascript has no built in support for URL parameters.

    Anyway, the location.search property returns the portion of current page URL starting from the question mark ('?').

    From this, you can write your own parameter parser or you can make use of one of those available in most common Javascript frameworks, such as JQuery and similar.

提交回复
热议问题