在把手中使用js脚本?

时间:2015-11-19 22:03:42

标签: javascript handlebars.js

我在将js脚本加载到把手时遇到了问题。我知道我的代码是错的,但不确定我应该如何处理?我已将代码包含在内供您参考。有人能指出我如何获得把手在jtml中包含js并执行的正确方向吗?

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title>Passionfruit App Test</title>
    <link rel="stylesheet" href="../site/css/screen.css">
    <link rel="stylesheet" href="../site/css/cupertino/jquery-ui-1.10.0.custom.css">
</head>
<body>
    <div id="data">
        <form id="addData" action="#">
            <div>
                <label for="coverImage">CoverImage: </label><input id="coverImage" type="file" />
                <label for="title">Title: </label><input id="title" type="text" />
                <label for="author">Author: </label><input id="author" type="text" />
                <label for="releaseDate">Release date: </label><input id="releaseDate" type="text" />
                <label for="keywords">Keywords: </label><input id="keywords" type="text" />
                <button id="add">Add</button>
            </div>
        </form>
    </div>
    <script id="dataTemplate" type="text/template">
        <img src="<%= coverImage %>"/>
        <ul>
            <li><%= title %></li>
            <li><%= author %></li>
            <li><%= isNaN(releaseDate) ? releaseDate : $.format.date(new Date(Number(releaseDate)), 'MMMM yyyy') %></li>
            <li><% _.each( keywords, function( keyobj ) {%> <%= keyobj.keyword %><% } ); %></li>
        </ul>

        <button class="delete">Delete</button>
    </script>
    <script src="../site/js/lib/jquery-1.9.0.js"></script>
    <script src="../site/js/lib/jquery-ui-1.10.0.custom.js"></script>
    <script src="../site/js/lib/jquery-dateFormat-1.0.js"></script>
    <script src="../site/js/lib/underscore.js"></script>
    <script src="../site/js/lib/backbone.js"></script>
    <script src="../site/js/models/data.js"></script>
    <script src="../site/js/collections/library.js"></script>
    <script src="../site/js/views/data.js"></script>
    <script src="../site/js/views/library.js"></script>
    <script src="../site/js/app.js"></script>
</body>

0 个答案:

没有答案