I am trying to load a text file in HTML page. The content of the text file is in German and I see � this symbol for German characters ä,ö,ü.
I have used <meta charset="UTF-8">
in the head tag of html page and also tried saving the text file in ANSI and UTF-8 but didn't work.
Here is my code:
$.ajax({
type: "GET",
url: lnk3,
crossDomain: true,
dataType:"text",
processData: false,
xhrFields: {
withCredentials: true
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
console.log("Ajax call failed");
},
success: function(jsonData) {
$("#description").html(jsonData);
}
});
and the HTML Code
<html>
<head>
<meta charset="UTF-8">
<script src="jquery-2.1.3.min.js"></script>
<script src="base64.js"></script>
</head>
<body>
<div id="demo3">
<button class="bck" onclick="loadFile()">Back</button>
</div>
<div id="description">
</div>
</body>
</html>
Text file is loaded in div tag with id="description" and the text file that I want to load is stored on sharepoint
Please help me to solve this issue