3
我在黑莓9300(5.0.0.832)上。我試圖以編程方式添加一個JavaScript元素。 如何在Blackberry瀏覽器上動態添加腳本元素?
var script=document.createElement('script');
script.src='file.js';
script.type='text/javascript';
script.onload=function(){alert('loaded');}; //Nothing happens
script.addEventListener('load', function(){alert('loaded');}, false); //Nothing happens
script.addEventListener('readystatechange', function(){alert('state changed');}, false); //Nothing happens
script.onreadystatechange=function(){alert('state changed')}; //Nothing happens
document.getElementsByTagName('head').item(0).appendChild(script);
有什麼辦法可以解決這個問題嗎?