Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

102
Vistas
How can I get a result from the function $(window).on("message")?

I want to get "msg.sheet" and "msg.instance_url" out of the following code:

function checkT() {
    $(window).on("message", async function (event) {
        let origin = event.origin || event.originalEvent.origin;
        if (origin !== "https://***.***.com") return;
        let msg = event.data || event.originalEvent.data;
        if (msg.sheet == 'undefined') {
            client.invoke('notify', 'You must login in.');
        } else {
            return {
            sheet: msg.sheet,
            instance_url: msg.instance_url
        }
        }
    })
}

let data = checkT()
console.log(data) // {sheet: msg.sheet, instance_url: msg.instance_url}

can it be solved with promises?

about 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda