Ajax 调用删除 post 中的特殊字符

Ajax call remove the special characters from post

我有以下 AJAX 调用

url: '/Admin/UserManagmentUpdatemobile',
                type: 'GET',
                data: "UserName=" + userName + "&Email=" + corpEmail + "&MobileNo=" + mobileNo 

并且手机号码有这个 value ='+97111111111' 当数据发布到服务器时它删除了 + 我该如何处理这个, 谢谢

如果您将数据作为对象传递给 jQuery.ajax,它将被正确编码

url: '/Admin/UserManagmentUpdatemobile',
type: 'GET',
data: {UserName: userName, Email: corpEmail, MobileNo: mobileNo}, 

如果需要,您可以手动编码 encodeURIComponent

data: "UserName=" + encodeURIComponent(userName) + "&Email=" + encodeURIComponent(corpEmail) + "&MobileNo=" + encodeURIComponent(mobileNo)