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

114
Views
Cómo abrir la ventana del navegador en iframe usando JavaScript

Quiero abrir una aplicación dentro de iframe. Estoy usando el siguiente script para hacerlo. Pero no puedo abrirlo dentro de iframe.

¿Puede alguien ayudarme a descubrir cómo abrirlo en iframe ?

He intentado buscar la solución pero no la encuentro.

He proporcionado el código JavaScript completo aquí.

Intenté seguir el código.

 @{ string Url = ViewBag.Url; string Token = ViewBag.Token; string Response = ViewBag.Response; } <br /> <div id='signal'> <center><img src="~/images/gears.gif" /></center> </div> <iframe src="@Url"></iframe> <div id="output"></div> <div id="divBackground"></div>

JavaScript

 $(document).ready(function() { $.ajax({ url: '@Url'.replace(/amp;/g, ''), type: 'GET', beforeSend: function(xhr) { xhr.setRequestHeader('Authorization', 'Bearer ' + '@Token'); }, success: function(data) { var params = [ 'height=' + screen.height, 'width=' + screen.width ].join(','); var popUp; function showModal() { const iframe = document.createElement('iframe'); iframe.src = '@Url'; document.body.appendChild(iframe); //popUp = window.open("", "_blank", params); popUp.location.href = data.message; popUp.focus(); LoadModal(); } function LoadModal() { var bkg = document.getElementById("divBackground"); bkg.style.display = "block"; } function OnUnload() { if (false == popUp.closed) { popUp.close(); } } window.onunload = OnUnload; showModal(); }, statusCode: { 400: function() { alert("server returned a bad request response."); } }, complete: function() { $("#signal").hide(); } }); });
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!