gpt4 book ai didi

javascript - as3 ExternalInterface.call 导致浏览器崩溃

转载 作者:行者123 更新时间:2023-11-28 03:44:43 24 4
gpt4 key购买 nike

我写了一个 html 页面,它使用一些 javascript 来隐藏和显示 flash 电影对象。一切正常,直到我尝试退出选项卡,当发生这种情况时,整个浏览器将崩溃,连错误文本框都没有。谁能帮忙?谢谢

闪码

if(ExternalInterface.available)
ExternalInterface.call('hideTimeline');

Javascript 代码

function showTimelineFirstPlay()
{
var timeline = document.createElement('span');
timeline.id = "timeLineer"
// WIDTH=1217 HEIGHT=170

//document.write(document.getElementById('topper').offsetHeight);
var fHeight = document.getElementById('topper').offsetHeight;
var fWidth = document.getElementById('topper').offsetWidth - 10;
var hHeight = fHeight + 100;
var hWidth = fWidth - 150;

timeline.innerHTML = "<OBJECT id='fTrans' allowScriptAccess='sameDomain' style = 'solid;border-color:#960000; border-width:3px;position:absolute; top:95; left:15;' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' WIDTH="+fWidth+" HEIGHT="+fHeight+"> <PARAM NAME=movie VALUE='FirstPlay.swf'> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#ffffff> </object><span onclick='hideTimeline()'style='color:#0098db;position:absolute; left:"+hWidth+"; top:"+hHeight+"'>- Hide Timeline</sapn>";

topper.appendChild(timeline);
}

function hideTimeline()
{
topper.removeChild(document.getElementById('timeLineer'));
}

window.onload = function()
{
showTimelineFirstPlay();
}

最佳答案

插件可能会崩溃,因为您正在调用 hideTimeline 并在 SWF 等待响应时删除 SWF。
尝试在 hideTimeline 中启动一个计时器,它会在 50 秒后移除 Child

miliseconds.topper.removeChild(document.getElementById('timeLineer'));

关于javascript - as3 ExternalInterface.call 导致浏览器崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7422219/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com