Underscore.js Template Issue - Невозможно вызвать метод replace вместо null

Я искал и нашел много ответов, но ни один, кажется, не работает.

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>
           Shopping Cart
        </title>
        <link rel="stylesheet" href="lib/style.css" type="text/css">
    </head>
    <body>
<script id="rtemp" type="text/x-underscore-template"">
            <span><%= title %></span>
    </script>
        <script src="lib/jquery.js" type="text/javascript"></script>
        <script src="lib/underscore.js" type="text/javascript"></script>
        <script src="lib/backbone.js" type="text/javascript"></script>
        <script src="lib/script.js" type="text/javascript"></script>
    </body>
    <script>
var Photo = Backbone.Model.extend({


    initialize: function(){
        console.log('this model has been initialized');

        this.bind("change:title", function(){
            var title = this.get("title");
            console.log("My title has been changed to.. " + title);
            var pv = new PhotoView();
            pv.render();
        });

    },

    setTitle: function(newTitle){
        this.set({ title: newTitle });
    },

    setLocation: function(newLoc)
    {
        this.set({location:newLoc});
    }
});

var PhotoView = Backbone.View.extend
({
    el: $('body'),

    render: function(event)
    {
        var name = myPhoto.get('title');
        console.info(name);
        var template = _.template($('#rtemp').html(), {title:name});
        console.info(this.model);
        $(this.el).html(template);
        return this;
    }

});



    </script>
</html>

Первый;

Создать новый экземпляр метода

 var newPhoto = new Photo();
 newPhoto.setTitle('Fishing');

Это отлично работает, он будет загружаться в тело через шаблон. Однако если я сделаю это снова,

newPhoto.setTitle('Sailing');

Я получаю сообщение об ошибке - "Невозможно вызвать метод" заменить " из нуля & quot;

Нет ошибки в строке, но я считаю, что это в

var template = _.template($('#rtemp').html(), {title:name});

Ответы на вопрос(1)

Ваш ответ на вопрос