我试图在加载facebook sdk文件后执行一些页面初始化代码。目前它默默地失败了,我很难调试。
仅在firefox
上发生
$.getScript('//connect.facebook.net/en_US/all.js', function () {
debugger;
// debugger is never hit, or if I add any console.logs
});
答案 0 :(得分:0)
尝试传递脚本的完整路径。您可以使用.done
& .fail
可以解决任何错误
$.getScript( "http://somedomain/en_US/all.js" )
.done(function( script, textStatus ) {
console.log( textStatus );
})
.fail(function( jqxhr, settings, exception ) {
// Log the error
});