【发布时间】:2011-09-18 02:32:04
【问题描述】:
好吧,可以说我正在做类似的事情
http://localhost/ajax/social/pull/facebookstatus
在我的/ajax/social/pull/facebookstatus 上有一个类似的脚本
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
// Load the Visualization API and the piechart package.
google.load('visualization', '1', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawChart);
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {
// Create our data table.
var data = new google.visualization.DataTable();
回到我试图打电话的问题(让我们说http://localhost/myprofile)
$.ajax({
type: "POST", // Using the POST method
url: "/ajax/social/pull/facebookstatus", // The file to call
data: myfbdata,
dataType: 'html',
success: function(data) {
$('#ajax-placeputfb').hide().fadeIn(3000).html(data);
}
});
/ajax/social/pull/facebookstatus 上的脚本在 http://localhost/myprofile 上加载时不起作用
有问题吗?
谢谢
亚当斋月
【问题讨论】:
-
我无法连接到您的本地主机 :)
-
它是
lets say伙计:D,无论如何我们不能在 javascipt ajax 调用上加载 javascript 吗? -
它确实加载了,但是我显示图表的 JavaScript 没有显示,它显示了除此之外的所有其他内容。
-
你的 drawChart() 函数被调用了吗?
-
进行 AJAX 调用时服务器的 HTTP 响应是什么?是否有 HTTP 响应?