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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:13:47+00:00 2026-06-05T19:13:47+00:00

I want to insert the following include tag into my webpage using JavaScript. <!–#include

  • 0

I want to insert the following include tag into my webpage using JavaScript. <!--#include virtual='includes/myIncludeFile.htm' -->

I have tried the following but it doesn’t work: jQuery("<!--#include virtual='includes/myIncludeFile.htm' -->").appendTo(jQuery("body"));

I have outputted jQuery("<!--#include virtual='includes/myIncludeFile.htm' -->") to the console and it thinks that it is a comment object (see screenshot).

enter image description here

Where am I going wrong and how can it be done?

  • 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-05T19:13:49+00:00Added an answer on June 5, 2026 at 7:13 pm

    The basic premise of what you’re trying to do isn’t going to work. The HTML “include tags” you’re using are also known as “server-side includes.” That is, they are processed on the server before the page is sent to the client.

    By the time the JavaScript code is executing on the client, the server is already processing the response. The client-side code can’t initiate a server-side include.

    One thing you can do from the client-side is use something like jQuery’s .load() function to make a request to the server and load the response into a specified element on the page. Something like this:

    $('#includeDiv').load('includes/myIncludeFile.htm');
    

    This would dynamically load all of the contents from myIncludeFile.htm into an element of id “includeDiv” on the page.

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

Sidebar

Related Questions

I want to insert a row into the Database using SqlDataAdapter. I've 2 tables
I want to insert the following as the value for a variable in some
I want to insert a vector into a set like this: set<vector<prmEdge> > cammini;
I want to insert data into a table where I don't know the next
I have an std::map and I want to search for a key using a
I am using following query to bulk insert from one table to another. INSERT
Hi so I have the following code and I want to be able to
I want to insert records into the books table for every author in the
I have the following trigger on a table that redirects data and includes data
I have the following structure: var $html = $(<div id='a'><div id='b'><div id='c'></div></div></div>); I want

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.