passing string of arguments in a url string

This question already has an answer here:

  • Encode URL in JavaScript? 12 answers

  • I think you want to encode the args string so it can be represented as data, and not a literal continuation of the querystring.

    var strArgsString = encodeURIComponent("?Category=Customer&Year=2014");
    var intModuleNo = "2";
    var strOrigDashName = "Invoices"
    

    There are two additional options for encoding. encodeURI and escape. Please see Best practice: escape, or encodeURI / encodeURIComponent for further information.

    链接地址: http://www.djcxy.com/p/26536.html

    上一篇: 字符串的URI转义

    下一篇: 在一个url字符串中传递参数串