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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:37:46+00:00 2026-06-08T10:37:46+00:00

I want to append the html contents receiver back from the sever (server 2)

  • 0

I want to append the html contents receiver back from the sever (server 2) to the body of the current page (which I received from sever 1). This I want to achieve while loading the page (received from server 1).( Hence I am getting the original contents from two different servers.)

I tried using

function Faulttest() {var myarray=new Array();
    var urlarray=new Array();
$(document).ready(function(){
    $.get({
     url:"http://csce.unl.edu:8080/Anomalies/index.jsp",
     data: "html",
     success:  function(result) {
     alert(result);
     $('#body').append(result) // result will be the contents received from the server
     },
     dataType:"text/html"
    });
});
// more contents   
}

The HTML contents of the page are:

<body style="font-size:62.5%;" onload="Faulttest();" >
<div id="body" >
        <h1>content top </h1>
       //HTML CONTENTS GOES HERE
</div>
  • 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-08T10:37:49+00:00Added an answer on June 8, 2026 at 10:37 am

    It looks like you are trying to load a page from a different domain. Same Origin policy is going to give you trouble with that .You can’t do that !

    If the file you trying to load content from is in the same domain, you can do it easily by calling the jQuery get method.

    $(function(){
      $.get("somepageInyourdomain.html",function(data){
           $('#body').append(data);
      });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to load only the contents of the body of a page(sample.html) and
Lets say i have an external html page and I want to append text
I want to do something like this: var html = $(#media).html(); $(#multimedia-content).append(html); $(#multimedia-content).filter(*).removeAttr(id); The
i want to append unlimited number of HTML elements with data given as comment.
I want to .append to a div and pass the value on as html
All. I am using jquery. And I want to append element into loaded html
I want to create some DOM nodes with jQuery, append them to the html
I want to append a div inside a div which have many divs inside
I have a javascript function that appends elements into my HTML page. I want
I have this piece of html in my page. <p><a href=# id=addQueryPart >Add</a></p> <div

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.