0

我的代码:

<!DOCTYPE html>
<html>
<head>
    <meta charset='utf-8'>
    <title>View Initialization</title>

    <script type="text/javascript" src="js/jqyery.js"></script>
    <script type="text/javascript" src="js/underscore.js"></script>
    <script type="text/javascript" src="js/backbone.js"></script>

</head>

<body>
<script>

    SearchView = Backbone.View.extend({
            initialize: function(){
                console.log("View is initialized");
            }
    });

    var search_view = new SearchView();

</script>
</body>
</html> 

Firebug 向我显示以下错误:

类型错误:我不是函数

我的代码有什么问题?

4

1 回答 1

1

您似乎有语法错误。您需要更换:

<script type="text/javascript" src="js/jqyery.js"></script> 

和:

<script type="text/javascript" src="js/jquery.js"></script>

注意第一个拼写错误<script>已被替换(jqyery)。

于 2013-03-20T13:32:46.037 回答