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

184
Views
¿Cómo puedo verificar o resolver "indefinido" en JavaScript?

¿Cuál es la forma más adecuada de probar si una variable no está definida en JavaScript?

Tengo un bloque de Publicado Sí y No.

 <div class="card mb-3"> <div class="card-header">{{ __('Published') }}</div> <div class="card-body"> <div class="form-check"> <input class="form-check-input published_filter" type="radio" name="published" id="yes" value="1"> <label class="form-check-label" for="yes"> Yes </label> </div> <div class="form-check"> <input class="form-check-input published_filter" type="radio" name="published" id="no" value="0"> <label class="form-check-label" for="no"> No </label> </div> </div> </div>

Cuando hago clic en Sí y No, veo esta alerta undefined .

 <script> $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') } }); $(".published_filter").change(function(){ var publish = $(this).val(); $.ajax({ type:'POST', url:"{{ route('category-filter') }}", data:{publish: publish}, success:function(data){ alert(data.success); } }); }); </script>JAVA
about 4 years ago · Santiago Gelvez
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!