开发者

Jquery getScript($.getScript()) not working on chrome?

开发者 https://www.devze.com 2023-01-11 02:52 出处:网络
I have a problem using $.getScript() on chrome. It doesn\'t work on chrome browser. I\'ve tested it on firefox, ie and safari and it worked. All I have on my external script is an alert() and it doesn

I have a problem using $.getScript() on chrome. It doesn't work on chrome browser. I've tested it on firefox, ie and safari and it worked. All I have on my external script is an alert() and it doesn't work.

Here's the code:

page

$(document).ready(function(){
  $("#btnGet").click(开发者_如何学编程function(){
   $.getScript("script.js");
  });
});

script.js

alert('Get script loading');

Is anyone have experienced this problem?


Thanks guys for making it clear to me.

I think I would have my script inline instead since the inline code will work fine on all browsers.

0

精彩评论

暂无评论...
验证码 换一张
取 消