[英]Cannot dynamically load JavaScript file twice in IE
我已经建立了这个页面。 当您单击表中的某一行时,该页面会发送一个数据的ajax请求,然后在被称为加载图形的主体中动态创建一个脚本。 它适用于所有chrome和FF,但不适用于IE8。 意思是 - 当你点击行时它工作但第二行和脚本没有加载..我甚至不知道如何在IE8中调试它。 谁能推荐一个解决方案? :-)
加载其他脚本的脚本是
$.post("shorts.server.php", $.param({
val: stocknumber,
id: id,
name: stockname,
group: stockgroup
}), function (response) {
//alert(response);
// We dynamically add javascript headers
var head = document.getElementsByTagName('body')[0];
script = document.createElement('script');
//dynamic_graph.js changes it's content by the current selected stock
//see shorts.server.php for details
script.src = 'jQuery/head/dynamic_graph.js';
head.appendChild(script);
script = document.createElement('script');
//dynamic_graph.js changes it's content by the current selected stock
//see shorts.server.php for details
script.src = 'jQuery/head/dynamic_info.js';
head.appendChild(script);
});
尝试使用jQuery.getScript :
function(response)
{
$.getScript('jQuery/head/dynamic_graph.js');
$.getScript('jQuery/head/dynamic_info.js');
}
在IE9中按F12运行调试器。 在调试器中,您可以选择浏览器模式,如:IE8。 使用Jquery进行所有DOM交互和浏览器兼容性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.