外部JavaScript甚至没有运行思想路径是正确的

时间:2017-03-03 17:02:20

标签: javascript

我正在尝试运行我的脚本,但HTML在获取它时遇到了一些麻烦。我已经按照w3s教程,但我似乎无法在这里找到问题。

<!doctype html>   
<html lang="en">      
<head> 

  <title>Javascript</title>    
  <meta charset="utf-8"> 
  <meta name="" content="HTML5">      
  <script type="text/javascript" src="h5.js"></script>  

</head>       
<body> 

    <p> Book details: <div id="bookDetails"> </div> </p>

</body> 
</html>

h5.js

 window.onload = callFunctions; 

    function callFunctions() { 

        var book = {
            name: "Javascript",
            authors: ["Carl Coder","Peter Programmer"],
            isbn: "ABC-12345-XY",   
            bookDetails: function(){return "name:" + this.name + "authors:" + this.authors + "isbn: " + this.isbn;}
        };
        document.getElementById("bookDetails").innerHTML = book.bookDetails();
    }

0 个答案:

没有答案