2013-03-26 73 views
0

例如在我的JSON文件中,我有字符「ä」。但是,當我的HTML加載它不渲染。我需要向Ajax添加什麼嗎?如何保存從JSON加載的特殊字符

$.ajax({ 
     url: "json/content.json", 
     data: "nocache=" + Math.random(), 
     type: "GET", 
     contentType: "application/json", 
     dataType: "json", 
     success: function(source){ 
      data = source; 
      showInfo(); 
     }, 
     error: function(data){ 
      alert("Failed to load content"); 
     } 
    }); 

謝謝!

+0

我想你需要在你的html頁面中編輯標記 – egig 2013-03-26 10:22:07

回答

1

這聽起來像一個字符集問題,json沒有特殊字符的問題。 確保服務器回覆和顯示它的html頁面之間的字符匹配。