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

175
Vistas
Get Request in iframe URL

Currently a 3rd party is serving up my URL in their iframe. All they have is an iframe for me and are not very flexible. They hard code whatever URL I have previously provided.

<iframe url="https://firstURL.com"></iframe>

I now want to differentiate a person between 2 groups. So, if they are in group 1, they go to the current flow url. If they're in group 2, I'd like the iframe to serve up a different url. I have a api that would receive that person's information, determine what group they are a part of, and then return the correct URL that pertains to their group.

app.get("/PersonCheck", function ( req, res ) {
    var personInfo = req.query.personInfo || 100;
    var tf = callGroupManagement( personInfo ); //returns true or false
    console.log("tf is ", tf);
    if( !tf ){
        res.send('https://firstURL.com');
    } 
    else {
        res.send('https://secondURL.com');
    }
}

So, since I have little flexibility I'd like to do something like this:

<iframe url="http://myApi.com/PersonCheck"></iframe>

However as you probably can guess that method returns https://firstURL.com and https://secondURL.com as strings and just shows them as strings in the iframe.

QUESTION: Is there a way render a returned url in the iframe url call? If not what would be a better strategy to achieve this.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The answer isn't on the iframe side. In the server side code I change:

res.send(<whateverURL>);

to the following:

res.redirect(<whateverURL>);

This "changes" the URL of the iframe 1) it's an iframe and 2) in my case that doesn't matter.

More notes can be found in the express docs

over 4 years ago · Santiago Trujillo Denunciar
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