What JavaScript library should I use for parsing URL parameters?

前端 未结 8 1583
终归单人心
终归单人心 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:31

    If it's "submitting to itself," do you need to do GET parameters?

    But if you do, most browsers now have the decodeURIComponent function which will handle individual parameters; your job is to split them on & (String#split will do that nicely). If you want a library, jQuery and Prototype are both well-used and tested.

提交回复
热议问题