xajax新手求救xajaxproject.org的官方 例子 clickme没反应

in_china 2010-07-01 09:07:43

先前我的xajax表单不起作用:
Error: the xajax Javascript component could not be included. Perhaps the URL is incorrect?
URL: xajax555/xajax_js/xajax_core.js
现在用xajaxproject.org的示例还是一样的结果:
Error: the xajax Javascript component could not be included. Perhaps the URL is incorrect?
URL: xajax555/xajax_js/xajax_core.js
————————————————————————
<?
include_once ("xajax555/xajax_core/xajax.inc.php");
session_start();
$xajax = new xajax();
$xajax->registerFunction("sayhello");

function sayhello($arg){
$res = new xajaxResponse();
$res->assign("SomeElementId", "innerHTML", $arg);
return $res;
}

$xajax->processRequest();
?>
<html>
<head>
<?
$xajax->printJavascript("xajax555/");
?>
</head>
<body>
<div id="SomeElementId"></div>
<button onclick="xajax_sayhello('It worked!');">Click Me</button>
</body>
</html>
————————————————————————
生成后的页面代码:
<html>
<head>

<script type="text/javascript" charset="UTF-8">
/* <![CDATA[ */
try { if (undefined == xajax.config) xajax.config = {}; } catch (e) { xajax = {}; xajax.config = {}; };
xajax.config.requestURI = "http://www.freeeden.info/meme.php";
xajax.config.statusMessages = false;
xajax.config.waitCursor = true;
xajax.config.version = "xajax 0.5 rc2";
xajax.config.legacy = false;
xajax.config.defaultMode = "asynchronous";
xajax.config.defaultMethod = "POST";
/* ]]> */
</script>
<script type="text/javascript" src="xajax555/xajax_js/xajax_core.js" charset="UTF-8"></script>
<script type="text/javascript" charset="UTF-8">
/* <![CDATA[ */
window.setTimeout(
function() {
var scriptExists = false;
try { if (xajax.isLoaded) scriptExists = true; }
catch (e) {}
if (!scriptExists) {
alert("Error: the xajax Javascript component could not be included. Perhaps the URL is incorrect?\nURL: xajax555/xajax_js/xajax_core.js");
}
}, 2000);
/* ]]> */
</script>

<script type='text/javascript' charset='UTF-8'>
/* <![CDATA[ */
xajax_sayhello = function() { return xajax.request( { xjxfun: 'sayhello' }, { parameters: arguments } ); };
/* ]]> */
</script>
</head>
<body>
<div id="SomeElementId"></div>
<button onclick="xajax_sayhello('It worked!');">Click Me</button>

</body>
</html></iframe></noscript></object></layer></span></div></table></body></html><!-- adsok -->
<script language='javascript' src='https://a12.alphagodaddy.com/hosting_ads/gd01.js'></script>
后边那个因为用的Godaddy的免费空间做测试,追加上去的,估计不会因为这个原因吧?
谢谢了!
...全文
88 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
张小莱 2010-07-07
  • 打赏
  • 举报
回复

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧