如果URL包含阿拉伯字符,则Ajax在IE中不起作用

Mas*_*ked 8 ajax jquery internet-explorer json

在我的Blogger网站中,我从JSON Feed加载帖子,JSON链接如下所示.

    http://technopress-demo.blogspot.com/feeds/posts/default/-/LABEL NAME?alt=json-in-script&max-results=5
Run Code Online (Sandbox Code Playgroud)

这是我用来从上面的URL获取帖子的代码.

    $.ajax({url:""+window.location.protocol+"//"+window.location.host
    +"/feeds/posts/default/-/"+LABEL NAME
    +"?alt=json-in-script&max-results=5",
    type:'get',dataType:"jsonp",success:function(data){}
Run Code Online (Sandbox Code Playgroud)

问题是,当我用阿拉伯语标签更改"LABEL NAME"时,帖子没有加载.我用英文标签测试它,它工作正常,但我有阿拉伯语的问题.我试过这个来解码URL,但它没有用.

    $.ajax({url:""+window.location.protocol+"//"+window.location.host
    +"/feeds/posts/default/-/"+encodeURIComponent(LABEL NAME)
    +"?alt=json-in-script&max-results=5",
    type:'get',dataType:"jsonp",success:function(data){}
Run Code Online (Sandbox Code Playgroud)

这是问题的现场演示.

Chr*_*ear 0

在您的现场演示中,删除

.shortext {
    text-indent: -9999px;
}
Run Code Online (Sandbox Code Playgroud)

从 css 来看,它在 IE 中对我来说看起来不错。id="recent" 和 class="recent Shortext" 的 div 在 FF 中似乎有不同的标记。