Get escaped URL parameter

后端 未结 19 2731
小蘑菇
小蘑菇 2020-11-21 13:41

I\'m looking for a jQuery plugin that can get URL parameters, and support this search string without outputting the JavaScript error: \"malformed URI sequence\". If there is

19条回答
  •  忘掉有多难
    2020-11-21 14:04

    You should not use jQuery for something like this!
    The modern way is to use small reusable modules through a package-manager like Bower.

    I've created a tiny module that can parse the query string into an object. Use it like this:

    // parse the query string into an object and get the property
    queryString.parse(unescape(location.search)).search;
    //=> æøå
    

提交回复
热议问题