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 8147997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:32:41+00:00 2026-06-06T14:32:41+00:00

I want to have a simple HTML file act as a bootstrap for a

  • 0

I want to have a simple HTML file act as a bootstrap for a second HTML file (which will be loaded using AJAX, then processed with javascript), which would replace the first entirely.

bootstrap.htm

  1. loads content.htm using AJAX (jQuery fine for this job)
  2. modifies content using javascript (various custom filters/modifications required)
  3. replaces itself with newly modified content

I expect it might not be 100% possible, as replacing the doctype might be hard, but I expect it is not too hard to replace all the body content, and all the head content (maybe just all the content of HTML?)

Does anyone have any advice on how to go about this?

EDIT: I tried to directly do what I really want…

$.get("content.htm", function(d) {
  console.log(d);
  return $(document).html(d);

But this does not work, and leaves me with an empty document
});

EDIT: Best solution so far (still conceptual)

  • bootstrap.htm loads, and is very careful only to create one global variable (lets saybs)
  • bootstrap.htm then loads the content.htm file, and processes it further
  • bootstrap.htm replaces the html tag content with the contents of the processed content.htm‘s html tag
  • bootstrap.htm then searches the new content, and executes any inline javascript, being careful not to execute code that has already been executed
  • bootstrap.htm removes it’s global variable (although there is little point at this stage, when most of the imported code has already been run)

This still does not allow the DOCTYPE to be changed, and the executing of imported code seems a bit unreliable, but this is the best idea I have so far.

  • 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-06T14:32:44+00:00Added an answer on June 6, 2026 at 2:32 pm

    I think that the main caveat would be for JavaScript code that is not executed. If you are loading “pure” HTML, I think the methods suggested by the other user (and that you foresaw) will be fine, providing that docype and HEAD will not be changed.

    See also: Calling a JavaScript function returned from an Ajax response

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an HTML file and i want to convert to XML only using
I have a file uploader module. The UI is created using simple HTML and
I have a very simple pure html file in which I have many PDF
I have a simple place-holder html-file that I would want to use the header
I have a simple HTML. I am using the JQuery for AJAX purpose. Now,
I have a simple HTML file which references .gadget so that it can be
So I have this simple HTML: <span id=badge>0</span> I want the number 0 to
I want to produce a simple, static HTML file, that has one or more
I want to print using php_printer.dll. I have no problem printing a simple text
I have encountered a unique problem. I am doing a simple ajax call using

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.