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的免费空间做测试,追加上去的,估计不会因为这个原因吧?
谢谢了!
...全文
30 点赞 收藏 1
写回复
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
张小菜1024 2010-07-07
回复
发动态
发帖子
基础编程
创建于2007-09-28

2.1w+

社区成员

从PHP安装配置,PHP入门,PHP基础到PHP应用
申请成为版主
社区公告
暂无公告