无法加载在FF服务器数据的IE仅
问题描述:
我不打算你调试它,但也许你可以看到一个时刻: 我写了一个简单的页面,显示“运行的邮件”。无法加载在FF服务器数据的IE仅
但是它适用于Chrome浏览器只(不FF或者IE) http://hydepark.apphb.com/display.aspx 我看到这是一个服务器端的问题,但它没有任何意义,因为它是依赖于浏览器。
你有一个想法?
var msgsList = [{"Guid":"c281e6ec-acdc-4c35-80ee-12c9ba1ab95e","Author":"2","Content":"222","Email":"22","CreationDate":"\/Date(1321389457043)\/","Rating":0,"Path":"D:\\websites\\b1\\08c47\\4f839e3\\_PublishedWebsites\\TB.Site\\c281e6ec-acdc-4c35-80ee-12c9ba1ab95e.html"},{"Guid":"58aaa80d-f09e-439a-bec6-60b090f39c26","Author":"1","Content":"111","Email":"11","CreationDate":"\/Date(1321389451653)\/","Rating":0,"Path":"D:\\websites\\b1\\08c47\\4f839e3\\_PublishedWebsites\\TB.Site\\58aaa80d-f09e-439a-bec6-60b090f39c26.html"}];
var pagePath = window.location.pathname;
//parses the list
$(document).ready(function()
{
parseList = function(pos,list)
{
if (pos < list.length)
{
var obj = list[pos];
TextArea1.value = obj.Content;
Author.value = obj.Author;
var newHeading = encodeURIComponent(window.location.href +"?id="+ obj.Guid);
var likeFrame = $('.fb-like iframe');
//var likeFrame = $('iframe.fb_ltr')[0];
var newHref = 'href=' + newHeading + '&layout=';
var newSrc = likeFrame.attr('src').replace(/href=.+&layout=/, newHref);
likeFrame.attr('src', newSrc);
setTimeout(function(){parseList(++pos,list);}, 5000);
}
else
{
//PageMethod('RefillMessages', [], AjaxSucceeded, AjaxFailed);
WebMethod('RefillMessages', [], AjaxSucceeded, AjaxFailed);
}
}
setTimeout(function(){parseList(0,msgsList);}, 2000);
//parseList(0,msgsList);
});
答
TextArea1.value = obj.Content;
你不应该仅仅通过它的ID号和一个元素。一些浏览器将支持这种适用于大于10年前的旧编码方式。
document.getElementById("TextArea1").value = obj.Content;
+0
再次尝试,但得到2 fb-likes和fb错误。你能回顾一下吗? –
答
如果你在Firefox打开Firebug,你会看到TextArea1
是不确定的。
它看起来Chrome正在考虑它作为一个全局变量,而FF不。
一个简单的方法来读取形式是和ID得到它,并用自己的名字阅读领域,如:
var frm = document.getElementById('form1');
//then get it by frm.TextArea1.value
失败[基本自动化QA(http://validator.w3.org /check?uri=http%3A%2F%2Fhydepark.apphb.com%2Fdisplay.aspx&charset=%28detect+automatically%29&doctype=Inline&group=0)。不要依赖浏览器错误恢复。 – Quentin