$("#ajaxPostZh").click(function() { var merchantVal = { id : 1234567, name : "喵喵", alias:":喵喵%", content:encodeURIComponent("aa%cc哈哈bbb") }; $.qAjax({ url : "http://enterprise.qbao.com/mechant/enterprise/register4.html", data : merchantVal, success : function(data) { } }); }) $("#ajaxGetZh").click(function() { var merchantVal = { id : 1234567, name : "喵喵", alias:":喵喵%", content:encodeURIComponent("aa%cc哈哈bbb") }; $.qAjax({ url : "http://enterprise.qbao.com/mechant/enterprise/register4.html?"+"v="+encodeURIComponent("aa%cc哈哈bbb"), type : "get", data : merchantVal, success : function(data) { } }); })
ajax post 或者get,键值对会被自动urlEncode
=====================
==================
URL是不同的
ajax URL如果直接出现中文,中文会被urlEncode,但是不会对%做encode