Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within HTML Pages with CSS and JavaScript
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
HTML Pages with CSS and JavaScript
Rest call using Backbone js fetch error
Sumant Chahar
Greenhorn
Posts: 4
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
I am new to backbone.js or any other javascript libraries. I am trying to call a rest service using backbone.js
below is the js file.
backboneDD.js
Rate = Backbone.Model.extend({ currRate : null, url: "rest url here which works fine and returns a json response", }); Rates = Backbone.Collection .extend({ model : Rate, initialize : function() { alert('In collection init'); } }); rate = new Rate; alert("Gonna fetch now") rate.fetch({ success : function(collection, response) { alert(response); return response; }, error : function() { alert("error"); } }); AppView = Backbone.View.extend({ el : $('#rate-editor-container'), initialize : function() { this.render(); }, render : function() { var rate_select_template = _.template( $("#rate_select_template").html(), { labelValue : 'Something' }); $('#rate-editor-container').html(rate_select_template); }, }); var appview = new AppView();
I am getting an error alert. Please help.
Bear Bibeault
Sheriff
Posts: 67746
173
I like...
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
The first step is to remove the alerts and learn how to actually debug JavaScript. Open the Browser Tools and learn how to set breakpoints at the various parts in your code, so that you can look around and see what is actually going wrong.
You can find more information on the FAQ:
http://faq.javaranch.com/java/JavascriptLinks
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
I knew I would regret that burrito. But this tiny ad has never caused regrets:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
how create separate model , view and controller using backbone.js
Ajax call from HTML file not working
jQuery getJSON question
.getJSON not returning any response.
Ext JS: how to populate grid with values from servlet
More...