先前我的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的免费空间做测试,追加上去的,估计不会因为这个原因吧?
谢谢了!
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的免费空间做测试,追加上去的,估计不会因为这个原因吧?
谢谢了!
解决方案 »
- 如此简单的strpos为什么不能执行?
- 网站被黑后的快速恢复办法
- 我是刚转做PHP的
- php中全局变量的问题
- 救救我吧!头都晕了...
- [Share] Very simple script which generates an 8 digit paswoord cinsisting of letters and numbers and capital letters
- 为什么能正常导出mysql的数据库却不能正常导入
- 一个很辣手的问题,视频点播服务器的问题.
- PHP怎么提供下载?
- 请教个问题,关于解析Html+PHP到一个字符串的方法。
- dedesms提示信息窗口怎样加长时间
- 求助求助!!哪位大虾用PHP实现过RSA算法的
include_once需要绝对路径
谢谢南迁的候鸟的回答。
我反复查过多遍了,xajax555这个文件夹是放在根目录的。
xajax_core和xajax_js 放在xajax555文件夹中的。其他 .html和.php网页都正常,.js文件也正常,就是这个xajax不正常。郁闷几天了