Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

216
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda