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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:00:28+00:00 2026-06-10T23:00:28+00:00

im using jQuery load() method to send another html to my webpage. The html

  • 0

im using jQuery load() method to send another html to my webpage.
The html being loaded contains Javascript generated HTML.

Im using this function to load the html:

$(document).ready(function(){
    $("img#links").click(function(){
      $("div#content").load("links.html");
    });
  });

The links.html contains:

<h1 id="content">Links</h1>
<br>
<script>add_link("http://google.com");</script>

The add_link function generates me a table:

var add_link = function(link) {
  document.write("<table border=\"0\" width=\"100%\" height=\"50\" id=\"link\">");
  document.write("<tr>");
  document.write("<td width=\"50\"><img src=\"img/star.png\" /></td>");
  document.write("<td><a href=\"" + link + "\"><div class=\"link\">" + link + "</div></a></td></tr></table>");
}

However, when called instead of writing that js generated code into the webpage, it gets written to a blank page, containing only the table generated by JS.

  • 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-10T23:00:29+00:00Added an answer on June 10, 2026 at 11:00 pm

    When you call document.write() after the page loading has completed — definitely the case here — the browser will wipe out the original page. In other words, the browser interprets a call after the page is done to be an implicit request to “start over” with a blank page.

    Instead of using document.write(), then, you can use DOM APIs to append new content to the page.

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

Sidebar

Related Questions

There's placeholder on the page that is loaded asynchronously using jQuery load method. Page
When using jQuery.load to dynamically load HTML content into a webpage, what is the
After loading a PHP template (using jQuery's load function), this simple script won't make
I have three forms and using this jquery function $('form').submit(function() { $.ajax({ type: $(this).attr('method'),
I'm loading and inserting html-code using Jquery Load() method. But when I'm trying to
I am populating a select field using JQuery on page load using this method
I'm trying to load plaintext data using jQuery's load method. This plaintext includes line
I am using jquery load method to update divs , it works great until
I am trying to load mschart in my aspx page(SalesOverview.aspx) using jQuery.load() method, I
I am using jQuery to load a page by AJAX using $.ajax (suppose test.html).

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.