与jQuery.ajax()在IE8中未解决的问题? [英] Outstanding issues with jQuery.ajax() in IE8?

查看:104
本文介绍了与jQuery.ajax()在IE8中未解决的问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我加载饲料项目将使用这个jQuery的阿贾克斯()调用,这是我从的 http://www.makemineatriple.com/2007/10/bbcnewsticker/

I am loading feed-items into a ul using this jQuery .ajax() call, which I basically lifted from http://www.makemineatriple.com/2007/10/bbcnewsticker/

var timestamp = true; //set whether timestamp is displayed in
          $.ajax({
            type: "GET",
            url: "sample-feed.xml",
            dataType: "xml",
            success: function(xml) {                  
              $(xml).find('item').each(function(){
            var title = $(this).find('title').text();
            var link = $(this).find('link').text();
            if(title.length >=57){              
                title = title.substring(0,54) + "..."; 
            }
            var addItem = '<li class="tickerTitle"><a href="'+link+'">'+title+'</a>';
            if (Boolean(timestamp)== true){
                var time = new Date(Date.parse($(this).find('pubDate').text()));
                addItem +='<span class="timestamp">' + makestamp(time) +'</span></li>';
            }

            $('ul#news').append(addItem);
          });

它可以在Chrome 4和Firefox 3.6,但是我加载它在IE8,不知怎么的AJAX调用失败。我曾尝试使用IE8的开发者工具,看看它究竟是失败了,但我还没有成功呢。

It works in Chrome 4 and Firefox 3.6, but I load it up in IE8 and somehow the ajax call fails. I have tried to use IE8's Developer tools to see where exactly it fails, but I haven't been successful yet.

于是两个问题

  1. 这有什么错公然与我Ajax调用在这里,可能是$ P $看见它在IE它工作在FF / Chrome浏览器?
  2. pventing我
  3. 有什么特别的考虑,我必须做出对的Internet Explorer系列浏览器的问候这种特殊的jQuery的方法?
  1. Is there anything blatantly wrong with my ajax call here that could be preventing me from seeing it in IE where it works in FF/Chrome?
  2. Are there any special considerations I have to make for the Internet Explorer family of browsers with regards to this particular jQuery method?

我已经做了一些谷歌上搜索这个,但没有明显的就要到了。

I've done some googling on this but nothing obvious is coming up.

另外一个说明:我目前使用jQuery 1.3.2我由于在同一网站上的一些传统脚本。我曾尝试加载1.4.2,这对IE8相同的结果。

One other note: I am currently using jQuery 1.3.2 due to some legacy scripts on the same site. I did try loading 1.4.2 and it had the same results on IE8

推荐答案

你在做你的测试在本地文件系统?然后,你最有可能得到拒绝访问,因为每个文件被计为一个不同的产地和同源策略是由IE浏览器应用。

Are you doing your tests in local file system? Then you most probably get "Access denied", since each file is counted as a different origin and "same-origin-policy" is applied by IE.

如果是已经在服务器上,我建议你看HTTP流量您的计算机和服务器之间,使用Fiddler工具(http://fiddlertool.com),看看是否实际发出Ajax调用。

If it is on the server already, I suggest you watch HTTP traffic between your computer and the server, using Fiddler Tool (http://fiddlertool.com) to see if the ajax call is actually issued.

这篇关于与jQuery.ajax()在IE8中未解决的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆