サーバー(サーバー2)から現在のページ(サーバー1から受け取った)の本文にhtmlコンテンツレシーバーを追加したい。これは、(サーバー 1 から受信した) ページの読み込み中に達成したいことです (したがって、2 つの異なるサーバーから元のコンテンツを取得しています。)
使ってみた
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
}
ページの HTML コンテンツは次のとおりです。
<body style="font-size:62.5%;" onload="Faulttest();" >
<div id="body" >
<h1>content top </h1>
//HTML CONTENTS GOES HERE
</div>