Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8470669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:35:02+00:00 2026-06-10T16:35:02+00:00

I would like to embed HTML code into a html page. The styles from

  • 0

I would like to embed HTML code into a html page. The styles from the HTML embeded code is disturbing the complete layout, that´s why I want to use iframes. The problem is that there is no .html page to link to, because this HTML code is comming from the database. I have tryed something like:

<iframe>${htmlContent} </iframe>

Where ${htmlContent} contains a simple html content.

<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T16:35:03+00:00Added an answer on June 10, 2026 at 4:35 pm

    This answer assumes you’re able to strip out the <html> and </html> tags from your stored HTML, and are able to HtmlEncode it when placing into the your markup.

    Store the encoded HTML into something like a div…

    <div id="htmlstore" style="display:none;">{html goes here}</div>
    

    So it looks something like…

    <div id="htmlstore" style="display:none;">&lt;body&gt;This is my text&lt;/body&gt;</div>
    

    Then use the following Javsacript, which will “HtmlDecode” (there is no native javascript function to do this unfortunately) and then place into the iframe

    <script type="text/javascript">
      window.onload = function(){
        var html = document.getElementById("htmlstore").innerHTML;
        html = html.replace(/&lt;/g,"<").replace(/&gt;/g,">");
        var frameDoc = document.getElementById("newframe").contentWindow.document;
        frameDoc.documentElement.innerHTML = html;
      }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to embed some HTML on my website... I would like that: SEO
I would like to embed some SVG in an HTML page in a way
I would like to embed a javascript engine into an ANSI C application. In
I would like to embed user-specific data on-the-fly when distributing an APK from my
I have a custom View that I would like to embed in an WebView.
Hey guys, I have developed a small site that i would like to embed
I have a ViewController that has its own NIB. I would like to embed
I would like to run this script (embed drive list in a site) that
I have noticed that, from Google Maps page, you can get an embed link
I would like to use the universal code and have ran into difficulties getting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.