Xqib Hello World无法正常工作

时间:2014-06-24 15:51:14

标签: javascript html xquery

我正在尝试实现xquery的基本示例,但问题是Hello World。我已经正确下载并放置了mxqueryjs.nocache.js文件,因此我不知道问题出在哪里。

这是我的代码:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">  
    <title>HelloWorld</title>
    <meta charset="UTF-8"/>
    <script type="text/javascript" src="mxqueryjs/mxqueryjs.nocache.js"></script>
    <script type="application/xquery">
       b:alert("Hello World")
    </script>
  </head>
  <body>
    <h1>Hello world page.</h1>
  </body>
</html>

控制台输出:

Uncaught SecurityError: Blocked a frame with origin "null" from accessing a frame with origin "null". Protocols, domains, and ports must match. 6182B2DC971F7A2C7AEDC4F09F2BAE2D.cache.html:1
(anonymous function) 6182B2DC971F7A2C7AEDC4F09F2BAE2D.cache.html:1
Uncaught SecurityError: Blocked a frame with origin "null" from accessing a frame with origin "null". Protocols, domains, and ports must match. 6182B2DC971F7A2C7AEDC4F09F2BAE2D.cache.html:2867
(anonymous function)

这应该打开警告对话框并说出Hello World,但它什么也没做。在线示例如下:xqib - HelloWorld

Xqib home page

由于

1 个答案:

答案 0 :(得分:-1)

您需要下载此模块:www.xqib.org/js/module.xquery并使用脚本标记导入它:

script type="application/xquery" src="path_to/module.xquery"
相关问题