我需要以编程方式向<h:head>JSF页面添加JS和CSS资源.目前尚不清楚如何实现这一目标.有人可以给出提示或启动示例吗?
我正在尝试执行一个使用RequireJS(2.1.8),WireJS(0.10.2)和PhantomJS(1.9.2)的基本应用程序:
请帮助指出WireJS在PhantomJS下正常运行的缺失部分.
以下是我的app文件.
1)app.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>SaphirJS.core</title>
<script data-main="app" src="../../../target/deps/require-0.0.1/2.1.8/require.js"> </script>
</head>
<body>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
2)app.js
"use strict";
require.config({
baseUrl: ".",
packages: [
{ name: 'wire', location: '../../../target/deps/wire-0.0.1/0.10.2', main: 'wire' },
{ name: 'when', location: '../../../target/deps/when-0.0.1/2.4.1', main: 'when' },
{ name: 'meld', location: '../../../target/deps/meld-0.0.1/1.3.0', main: 'meld' }
]
});
require(["wire!wireContext"], function(wireContext) {
alert(wireContext.message);
});
Run Code Online (Sandbox Code Playgroud)
3)wireContext.js
define({
message: "Hello World!"
});
Run Code Online (Sandbox Code Playgroud)
4)phantom-runner.js
(function() {
'use strict';
var args = require('system').args,
timeoutRef = undefined,
timeLimit …Run Code Online (Sandbox Code Playgroud) 我已经使用GraphViz官方网站上描述的推荐程序在Fedora上安装了Graphviz .但是,我无法hello.dot使用dot命令转换基本文件.
我的hello.dot文件是:
graph hello {
Node1 [label="Hello, World!"]
}
Run Code Online (Sandbox Code Playgroud)
错误是:
$ dot hello.dot -Tpng -o hello.png
Format: "png" not recognized. Use one of:
$
Run Code Online (Sandbox Code Playgroud)