我看到很多关于此类型错误的帖子,例如here和here,但在我的情况下,我 在函数中有一个对象,如下面的代码,我得到这个错误“无法从释放的脚本执行代码”
function updateLetterOfClaim(thisletterClaimID) {
var updatedLetter = {};
updatedLetter.new_breaches = top.opener.selected_breach.join(",");//from this line in ie7 i get this error
updatedLetter.new_causation = top.opener.selected_causation.join(",");
updatedLetter.new_chronology = top.opener.chronology_records.join(",");
updatedLetter.new_Injuries = top.opener.damage_records;
}
答案 0 :(得分:0)
在看到许多链接和博客后,我的结果来自应用以下代码
我的问题是我发现我在对象中应用join()但它应用于数组中所以首先我做
我在数组中的对象然后应用join ....
function updateLetterOfClaim(thisletterClaimID) {
var updatedLetter = {};
updatedLetter.new_breaches =joinobjects(top.opener.selected_breach);
updatedLetter.new_causation =joinobjects( top.opener.selected_causation);
updatedLetter.new_chronology =joinobjects(top.opener.chronology_records);
updatedLetter.new_Injuries = joinobjects(top.opener.damage_records);
}
function joinobjects(object){
return $.map(object, function(v){
return v;
}).join(', ');
}