ajax工作但不显示内容?

时间:2014-04-29 04:30:48

标签: ajax

<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
<script type="text/javascript" src="Chat_Box_Files/Script_Files/AJAX.js"></script>
</head>

// JavaScript Document


$(document).ready(function(){
// load index page when the page loads
Load_ajax_page("http://betaserver.bioprotege-inc.net/chat_selector/Chat_Box_Files/Script_Files/Applet_Files/Index.html");

$("#ChatMaster").click(function(){
Load_ajax_page("#");
});

});



function Load_ajax_page(url){
//before we make a ajax request we have to show the loading image
$("#Applets").html('<center>Loading... Please Wait...</center>');

//this is a jquery method to make a ajax request
$.post(url,"",function (data){
//this is the place where the data is returned by the request
//remove loading and add the data
$("#Applets").html(data);
});

}


<div id="Applets">
</div>

http://jsfiddle.net/N278r/

这里是我操作中的小提琴,但是它不会显示来自html文件的内容,它曾经用来判断我做错了什么?

1 个答案:

答案 0 :(得分:0)

看起来您在服务器上使用ASP.NET。您可以将以下行添加到源页面:

Response.AppendHeader("Access-Control-Allow-Origin", "*");