未捕获的ReferenceError:没有定义Ajax



我在mybb论坛得到了一个错误。我使用了高级统计插件。但我得到了一个关于控制台"未捕获的ReferenceError: Ajax未定义"的错误,所以这就是为什么我的网站没有从顶部加载最新的帖子。

网站:http://satfriends.net/index.php

我的代码

<!-- start: changuondyu_stats_script -->
	<script language="JavaScript" type="text/javascript">
		var fcmenu;
var listtab = new Array();
listtab[0] = "allforum";
listtab[1] = "inforum&listforumid=8";
listtab[2] = "inforum&listforumid=21,15,7";
listtab[3] = "inforum&listforumid=14";
function cswitch(taborder)
{
fcmenu = listtab[taborder];
document.getElementById('ct'+taborder).className = 'thead';
for (i = 0; i <= 3; i++)
{
 if (i != taborder)
   {
    document.getElementById('ct'+i).className = 'tcat';
   }
}
changstats_post();
}
function hshowpost(request)
{
  if (request.readyState == 4 && request.status == 200)
	{
	document.getElementById('chang_latestposts').innerHTML = request.responseText;
	document.getElementById('cprogress_post').style.display="none";
	}
}
function hshowtop_user(request)
{
  if (request.readyState == 4 && request.status == 200)
	{
	document.getElementById('chang_top_user').innerHTML = request.responseText;
	document.getElementById('cprogress_top').style.display="none";
	}
}
function hshowtop_forum(request)
{
  if (request.readyState == 4 && request.status == 200)
	{
	document.getElementById('chang_top_forum').innerHTML = request.responseText;
	document.getElementById('cprogress_top').style.display="none";
	}
}
function changstats_post()
{
	document.getElementById('cprogress_post').style.display="inline";
	fcresult = document.getmenu.choosekq.value;
	new Ajax.Request('xmlhttp.php?do='+fcmenu+'&result='+fcresult, {method: 'GET', postBody: null, onComplete: function(request) { hshowpost(request); }});
}
function changstats_top_user()
{
	document.getElementById('cprogress_top').style.display="inline";
	fcmenu_top_user = document.getmenu.choosetop_user.value;
	fcresult = document.getmenu.choosekq.value;
	new Ajax.Request('xmlhttp.php?do='+fcmenu_top_user+'&result='+fcresult, {method: 'GET', postBody: null, onComplete: function(request) { hshowtop_user(request); }});
}
function changstats_top_forum()
{
	document.getElementById('cprogress_top').style.display="inline";
	fcmenu_top_forum = document.getmenu.choosetop_forum.value;
	fcresult = document.getmenu.choosekq.value;
	new Ajax.Request('xmlhttp.php?do='+fcmenu_top_forum+'&result='+fcresult, {method: 'GET', postBody: null, onComplete: function(request) { hshowtop_forum(request); }});
}
cswitch(0);
changstats_top_user();
changstats_top_forum();
</script>
<!-- end: changuondyu_stats_script -->

给一个解决方案,我怎么能解决它。

谢谢

必须包含对包含Ajax.Request方法的api的引用。在你的情况下,它似乎是Prototype库。

将库包含在html页面的顶部:

<script src="https://ajax.googleapis.com/ajax/libs/prototype/1.7.3.0/prototype.js"></script>

相关内容

  • 没有找到相关文章

最新更新