$("#ajaxPostZh").click(function() { var merchantVal = { id : 1234567, name : "喵喵", alias:":meowmeow%", content:encodeURIComponent("aa%cc haha 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:":meowmeow%", content:encodeURIComponent("aa%cc haha 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 or get, key-value pair will be automatically urlEncode
=====================
==================
URL is different
If the ajax URL directly appears in Chinese, the Chinese will be urlEncoded, but the % will not be encoded