Posted by Michael Heliso
In one of the project I have been involved, I had to create an Ajax menu. The issue showed up when the resource text of the menu items were in Greek. The response of the Ajax request was just junk. The issue resided in the fact that I have not specified on my Ajax request what character set it should be used. The problem was solved once I have specified that the value of charset it should be utf-8.
var url = location.protocol + "//" + location.host + "/MyWebSite/Default.aspx/GetMenuXml"; xmlHttp = GetXmlHttpObject(); xmlHttp.open("POST", url, true); xmlHttp.onreadystatechange = initializeMenu; xmlHttp.setRequestHeader("Man", "POST" + url); xmlHttp.setRequestHeader("MessageType", "CALL"); xmlHttp.setRequestHeader("Content-Type", "application/json; charset=utf-8"); xmlHttp.send(null);