Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

212
Views
on Backbone.js, events not firing

Now, I need to add some function to the old code which was written with Backbone.js. So, I am trying to write it and it seems works fine as below.

JavaScript

  getDetailedInfo: function(e){
    this.$('#get_detailed_info').click((function(){

    return function(e){
      $.ajax("/api/v1/internal/car_details_search", {
      }).done(function(data) {
        console.log(data)
      });
    }
    })(this));
  },

html

<button class="btnSmall" id="get_detailed_info" type="submit">get information</button>

but I got an order from reviewer that I should use "events" to fire the event.

So, I made my code just easy and tried to see if the events works, and rewrite it with "events" as below but nothing fires.

JavaScript

  events: {
    "click button.cancel": "goBack",
  },

  goBack: function(){
    console.log("Goback")
  },

html

<button class="moreBtn thirdly cancel">Cancel</button>

I have no idea how to fix it. Please help me if you know anything about this issue.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!