冒号运算符“:”作为“=”发送

colon operator ":" gets sent as "="

尝试了解 jQuery 中的 get() 请求,冒号运算符“:”被发送为“=”。谁能解释一下?请求已发送 http://192.168.1.1/?pin=111

我是Whosebug和java的新手,如果问题太基础,请多多包涵

$(".button").click(function () {                  
            var p = $(this).attr('id');           
            pin:p                       
            $.get("http://192.168.1.1:80/", { pin:p });
});

{ pin:p } 是一个 object literal.

jQuery 的 documentation 表示数据将被编码:

When data is an object, jQuery generates the data string from the object's key/value pairs unless the processData option is set to false. For example, { a: "bc", d: "e,f" } is converted to the string "a=bc&d=e%2Cf".

这是 a query string 的标准编码。