简体   繁体   English

为什么此google.load,google.setOnLoadCallback脚本不起作用?

[英]Why isn't this google.load, google.setOnLoadCallback script working?

Why doesn't this jquery work, according to firebug none of the javascript lines are being reached: 为什么这个jQuery不起作用,根据萤火虫,没有到达任何JavaScript行:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <script type="text/javascript"
        src="http://www.google.com/jsapi"></script>
        <script type="text/javascript">
            google.load("jquery", "1.4.0");
            google.setOnLoadCallback(function() {
              $("p").css("background-color","red");
            } 
        </script>
    </head>
<body>
  <p>test</p>
</body>
</html>

You have a missing right parenthesis ) : 您缺少右括号)

google.load("jquery", "1.4.0");
google.setOnLoadCallback(function() {
  $("p").css("background-color","red");
}); // <--- Here

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM