0

Hello,

I was following series of tutorials

http://net.tutsplus.com/tutorials/javascript-ajax/build-a-contacts-manager-using-backbone-js-part-5/

5 part is not finished yet. BUt I 4 parts are done.

In 5th part there is written about .net, but I want to use php.

The problem is - application worked fine when I was not using php - only html and js files. When I moved html to the codeigniter framework view file, I had to make few adjustmends - move script tags upper because otherwise for some unknow reason scripts were not redered.

Now scripts are redered as I see in view source. But I am getting error:

GET http://localhost/backbone_contacts_manager/%3C%=%20photo%20%%3E 400 (Bad Request)

where is that weird url coming from?

I found out that in this functiom

renderContact: function (item) {
            var contactView = new ContactView({
                model: item
            });
            this.$el.append(contactView.render().el);
        },

when I comment out line

 this.$el.append(contactView.render().el);

then I am not getting the error.

But now I don't know what to do to make it work. Can you help me?

The js and html files are here:

http://pastebin.com/VUaHcf2N
http://pastebin.com/gK4qpxyT

1
Contributor
1
Reply
2
Views
4 Years
Discussion Span
Last Post by McLaren
0

found out where the error came from:

_.templateSettings = {

// interpolate: /\{\{(.+?)\}\}/g // {{ }} syntax for templating insteat of of <%= property %>

};

even when this was commeted out, template did not recognize the tags. So I had to comment out all _.templatesettings and then it used default regex for recognizing tags.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.