jquery - WebAPI posting HTML entities cuts off parameters -


i'm posting contents of div server so.

$.ajax({     type:"post",     url: self.settings.spellcheckurl,     datatype: "json",     data: "=" + content,     processdata: false,     success: function(result) {         ...     } }); 

and works expected, when have html entity in content such   find cut off in web api controller.

raw post fiddler

=<div>the <i><u>raaina&nbsp;</u></i>in <i><u>spaaain </u></i><b><u>saatays</u> maaainly a</b>on <u>plaains</u>..</div> 

web api controller

enter image description here

what need prevent this?

try encode data before sending ,

var res = encodeuricomponent(uri); 

your case

 data: "=" + encodeuricomponent(content) 

javascript encodeuricomponent() function


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -