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

174
Views
Iframe doesn't load after script added to div in Iframe

I have an iframe that is made by Sendinblue that adds an email and a name to a subscriber list for emails about news and updates to the website. I try to add a script inside of script tags to a div inside of the iframe, and the script adds a cookie to my domain to make sure the subscription pop-up doesn't appear if the person has already subscribed. This is the script code that works and shows the iframe properly:

<script>
   var loadSubscribe = document.getElementById("iframeSubContainer");
   var subIframe = document.createElement("iframe");
   subIframe.src = "https://5eb037e3.sibforms.com/serve/MUIEAJ939z1Bq2LxF5Zhl4FTxrbO_BRWpsH3pI1Oc3BlfERyduUrKn8MZGOp_SfE8ANeCph9Ho774Ez3WHnEGB8HA2SUKdqotNxM9BrRc56WQOdxp2sXCz4l9pinjkJOMDiRsG9uY4SAvobb3Gv2BoKx_iWdBOaxVmg7qlkzPx6pzha-j8NErMxJXTB85a0OqOs-bLG8_y-Fi-xx";
   subIframe.width = "540";
   subIframe.height = "755";
   subIframe.frameBorder ="0";
   subIframe.scrolling = "no";
   subIframe.style["opacity"] = "1";
   subIframe.style["display"] = "block";
   subIframe.style["border"] = "none";
   subIframe.style["background"] = "white";
   subIframe.style["marginLeft"] = "auto";
   subIframe.style["marginRight"] = "auto";
   subIframe.style["maxWidth"] = "100%";
   subIframe.setAttribute("id", "subIframe");

   loadSubscribe.appendChild(subIframe)
</script>

and in the head tag i have:

<script src="http://code.jquery.com/jquery-latest.js"></script>

But, if I add

$('#subIframe').contents().find('#success-message').append('<script>document.cookie="CookieName=cookieData; expires=Thu, 01 Jan 2038 00:00:00 UTC; path=urlCookiePath/;"<\/script>');,

which adds the cookie script if a person subscribes and the success message is shown, and I put it right under

subIframe.setAttribute("id", "subIframe");,

the iframe does not appear at all. Am writing this wrong?

The link to the subscription page is here, so you can see the html source code

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!