我正在将div的内容发布到服务器上。
=<div>The <i><u>raaina </u></i>in <i><u>Spaaain </u></i><b><u>saatays</u> maaainly a</b>on the <u>plaains</u>..</div>
并且它按预期工作,但是当我在我的内容中有一个html实体,例如 Public WithEvents myOlItems As Outlook.Items
Public Sub Initialize_handler()
Set myOlItems = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items
End Sub
Private Sub myOlItems_ItemAdd(ByVal Item As Object)
Dim myOlMItem As Outlook.MailItem
Dim myOlAtts As Outlook.Attachments
Set myOlMItem = myOlApp.CreateItem(olMailItem)
myOlMItem.Save
Set myOlAtts = myOlMItem.Attachments
' Add new contact to attachments in mail message
myOlAtts.Add Item, olByValue
myOlMItem.To = "Sales Team"
myOlMItem.Subject = "New contact"
myOlMItem.Send
End Sub
时,我发现它在我的Web API控制器中被切断了。
来自Fiddler的原始POST
<script>
$(document).ready(function(){
$("#sub").click(function(){
var user_issue = $("#issue").val();
var user_priority = $("#priority").val();
var user_type = $("#type1").val();
$.post("BugReport.php",{issue:user_issue,priority:user_priority,type1:user_type},function(data){
$("#result").html(data);
//location.reload(true);
});
$.post('BugDisplay.php',{},function(data){
$("#BugDisplay").html(data);
});
document.getElementById('issue').value='';
document.getElementById('type1').value='Listing Discrepancy'; //this is my attempt at solving the problem.
});
$.post('BugDisplay.php',{},function(data){
$("#BugDisplay").html(data);
});
});
</script>
Web API控制器
我需要做些什么来防止这种情况?
答案 0 :(得分:1)
尝试在发送数据之前对数据进行编码,例如
var res = encodeURIComponent(uri);
你的案子
data: "=" + encodeURIComponent(content)