小编You*_*nes的帖子

如何以编程方式将JS和CSS资源添加到<h:head>?

我需要以编程方式向<h:head>JSF页面添加JS和CSS资源.目前尚不清楚如何实现这一目标.有人可以给出提示或启动示例吗?

javascript css jsf head

6
推荐指数
1
解决办法
4526
查看次数

使用PhantomJS运行RequireJS/WireJS应用程序

我正在尝试执行一个使用RequireJS(2.1.8),WireJS(0.10.2)和PhantomJS(1.9.2)的基本应用程序:

  • 使用PhantomJS运行应用程序时(这是我的目标),WireJS无法加载(请参阅下面的错误).
  • 使用Chrome运行应用时,它会正常完成.

请帮助指出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)

requirejs phantomjs wirejs

4
推荐指数
1
解决办法
2156
查看次数

Dot不支持新安装的Graphviz中的任何格式

我已经使用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)

fedora dot graphviz

2
推荐指数
1
解决办法
2531
查看次数

标签 统计

css ×1

dot ×1

fedora ×1

graphviz ×1

head ×1

javascript ×1

jsf ×1

phantomjs ×1

requirejs ×1

wirejs ×1