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

192
Views
datos a través de ajax para la lista blanca de tagify

Estoy tratando de obtener los datos a través de ajax para etiquetar la lista blanca. pero me sale el siguiente error

 ReferenceError: Can't find variable: clist

el código es:

 $.ajax({ url: '/ajaxget/tags', method: 'GET', data: { <?= csrf_token() ?> : '<?=csrf_hash()?>' }, success: function(response) { var clist = response; //alert(response); } }); var input = document.querySelector('input[name="tags"]'); tagify = new Tagify(input, { enforceWhitelist: true, whitelist: clist, maxTags: 5, dropdown: { maxItems: 5, classname: "tags-look", enabled: 0, closeOnSelect: false } });

cuando lo pruebo con "alerta (respuesta);" muestra los datos - ['123','333','763',asd']

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Está intentando acceder a una variable local desde la respuesta de devolución de llamada como variable global.

 $.ajax({ url: '/ajaxget/tags', method: 'GET', data: { <?= csrf_token() ?> : '<?=csrf_hash()?>' }, success: function(response) { var clist = response; populateList(clist); } }); function populateList(clist) { var input = document.querySelector('input[name="tags"]'); tagify = new Tagify(input, { enforceWhitelist: true, whitelist: clist, maxTags: 5, dropdown: { maxItems: 5, classname: "tags-look", enabled: 0, closeOnSelect: false } }); }
about 4 years ago · Juan Pablo Isaza Report
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!