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

133
Views
No se pueden leer datos de Jquery.Get()

Creé una ruta Node Server y app.get('/links') para tomar la lista completa de imágenes. En FrondEnd, estoy usando un archivo HTML estándar con JavaScript estándar y solo la función JQuery $.get() . Funciona perfectamente cargando datos en la consola, pero por alguna razón no puedo usar estos datos fuera de $.get() . ¿Cómo puedo leer estos datos en JS Script estándar incrustado en HTML ? Script FrontEnd incrustado en código HTML

 $.get('/links', (data) => { loaddata(data); }) let allImages= [] let firstImg = '' let lastImg = '' let totalImgs = 0 let currentImgIndex = 0 function loaddata(inpArr){ totalImgs = inpArr.length firstImg = inpArr[0] firstImg = inpArr[totalImgs-1] allImages = inpArr }

Ruta NodeJs

 var express = require('express') var fs = require('fs'); var array = fs.readFileSync('links.txt').toString().replace(/\r\n/g,'\n').split("\n"); for(i in array) { console.log(array[i]); } app = express() app.use(express.static(__dirname)) app.get('/links', (req, res) => { res.send(array) }) app.listen(3000)

Archivo de enlaces

 9th-Chem-2013-G1-011 9th-chem-ch-05-02 9th-chem-ch-05-03 9th-chem-ch-05-04 9th-chem-ch-05-05
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!