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

236
Visualizações
jQuery and livequery error on javascript code not executing?

I have some very old javascript code on an existing site and I wanted to update it, but I'm running into errors and I'm not sure what to replace it with. The code is just part of a section where it does a .submit() call to the form. Then the code reaches the try condition, it throws the error that livequery is not a function. Code is also below the screenshot.

Also I'm not sure if the "var form" is outside the scope of the try for form to work or not. What could I have wrong here?

enter image description here

var submit = false;
var form = $("#webform-client-form-2")[0];
try {
  if (repair) {
    console.log('repair is true - line 317');
    $(".simple-dialog").click();
    $(".ui-dialog, .ui-widget-overlay").hide();
    $(".form-actions").livequery(function() {
      console.log('livequery - line 321');
      $("#edit-submitted-name").val(subject_field);
      $("#edit-submitted-phone").val(phone);
      $("#edit-submitted-email").val(email);
      $("#edit-submitted-details-of-issue").val(problem);
      var find = $(".form-actions")[0]; //get the 1st form actions on the page. if more than 2 forms on page, this might submit wrong form.
      if (!submit && find) {
        console.log('repair is true - line 328');
        submit = true;
        $("#webform-client-form-2").submit();
        $(".form-actions").expire();
        return false;
      }
    });
  } else if (contact) {
  console.log('yyy');
  console.log(form);
    $("#edit-submitted-phone-number").val(phone);
    $("#edit-submitted-message").val(problem);
    $(form).submit();
  } else {
  console.log('zzz');
    $(form).submit();
  }
} catch (error) {
  console.log(error);
  console.log("no form - line 346");
}
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