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

169
Views
"Esto" no devuelve el valor solicitado

Soy principiante en Javascript, y tengo el siguiente problema... alguien me puede decir que estoy haciendo mal? Gracias !

Entonces, vaya a Instagram, complete el siguiente código en la consola:

 var open = window.XMLHttpRequest.prototype.open, onReadyStateChange; function openReplacement(method, url, async, user, password) { if (url.match(/https:\/\/i\.instagram\.com\/api\/v1\/feed\/user\/[0-9]{1,16}\/story\//g)) { console.log(url) console.log(this) console.log(this.response) } return open.apply(this, arguments); } window.XMLHttpRequest.prototype.open = openReplacement;

Entonces, cuando hago esto y voy a un perfil, se supone que debe leer e imprimir la respuesta de API para obtener los datos de la historia, e imprime lo siguiente para console.log(this) :

 XMLHttpRequest: listeners: {load: Array, error: Array, timeout: Array} onabort: null onerror: function(t) onload: function() onloadend: null onloadstart: null onprogress: null onreadystatechange: null ontimeout: function() readyState: 4 response: "{\"broadcast\":null,\"reel\":{\"id\":…" responseText: "{\"broadcast\":null,\"reel\":{\"id\":…" responseType: "" responseURL: "https://i.instagram.com/api/v1/feed/user/AN_ID/story/" responseXML: null status: 200 statusText: "" timeout: 10000 upload: XMLHttpRequestUpload {onloadstart: null, onprogress: null, onabort: null, onerror: null, onload: null, …} withCredentials: true

Pero cuando aparece la siguiente línea console.log(this.response) , se imprime una línea vacía. Y lo hace con todos los valores impresos en esta parte superior. Traté de console.log(Object.keys(this)) , pero igual, se imprime una línea vacía...

Si hago this.test = "test there" y hago console.log(this.test) , "test there" está bien impreso.

Qué estoy haciendo mal ??? ¿Por qué no me devuelve el valor de response de this ? Gracias por tu ayuda !

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!