2017-01-09 29 views
-1

我使用document.title通过使用JSON发送标题。但是,在IE中它只识别英文字符。我怎样才能解决这个问题?这是我目前的代码。document.title使用json在IE 11上使用符号发送,而不是在其他浏览器上使用

function browsing() { 
    $.getJSON("handler.php?type=browsing&callback=?&url=" + document.location.pathname + "&page=" + document.title); 
} 

这里是我的browsing函数的输出。

document.title output

+1

你用过了吗?'? –

+0

@DavidArchibald当然是的 – EnexoOnoma

+0

请问您能创建一个[最小化,可验证,完整示例](http://stackoverflow.com/help/mcve)吗? –

回答

0

尝试使用

$.getJSON("handler.php", { 
    type: 'browsing', 
    callback:'?', 
    url: document.location.pathname, 
    page: document.title 
}); 

这应该采取正确编码的文本URL使用的护理。

相关问题