0
我想包括JavaScript的標籤到JSP文件,但它不會呈現.. 的代碼看起來是這樣的:的JavaScript(包含在一個JSP)未呈現
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Insert title here</title>
<script language="JavaScript" src="AC_OETags.min.js"></script>
<script language="JavaScript" src="json2.min.js"></script>
<script language="JavaScript" src="cytoscapeweb.min.js"></script>
<script language="JavaScript">
window.onload=function() {
// network data could alternatively be grabbed via ajax
var xml = '\
<graphml>\
<key id="label" for="all" attr.name="label" attr.type="string"/>\
<key id="weight" for="node" attr.name="weight" attr.type="double"/>\
<graph edgedefault="undirected">\
<node id="1"><data key="label">1</data><data key="weight">1.8</data></node>\
<node id="2"><data key="label">2</data><data key="weight">1.1</data></node>\
<node id="3"><data key="label">3</data><data key="weight">1.1</data></node>\
<node id="4"><data key="label">4</data><data key="weight">1.1</data></node>\
<node id="5"><data key="label">5</data><data key="weight">.3</data></node>\
<node id="6"><data key="label">6</data><data key="weight">.3</data></node>\
<edge source="1" target="2" ></edge>\
<edge source="2" target="3" ></edge>\
<edge source="4" target="5" ></edge>\
<edge source="3" target="4" ></edge>\
<edge source="6" target="5" ></edge>\
<edge source="4" target="2" ></edge>\
<edge source="6" target="1" ></edge>\
</graph>\
</graphml>\
';
// init and draw
// initialization options
var options = {
swfPath: "CytoscapeWeb",
flashInstallerPath: "playerProductInstall"
};
var vis = new org.cytoscapeweb.Visualization("cytoscapeweb", options);
var draw_options = {
// your data goes here
network: xml,
// show edge labels too
edgeLabelsVisible: false,
edgeTooltipsEnabled:true,
// let's try another layout
layout: "circle",
// hide pan zoom
panZoomControlVisible: true
};
vis.draw(draw_options);
};
</script>
<style>
/* The Cytoscape Web container must have its dimensions set. */
html, body { height: 100%; width: 100%; padding: 0; margin: 0; }
#cytoscapeweb { width: 100%; height: 100%; }
</style>
</head>
<body>
<h1>The Graph</h1>
<div id="cytoscapeweb">
Cytoscape Web will replace the contents of this div with your graph.
</div>
</body>
</html>
它使用Cytoscape Web來渲染圖形。 如果我從一個普通的html文件運行它evereything工作正常...
任何建議?
你說的「不呈現」呢?您的html是否顯示,但腳本不包括在內?有什麼東西出現嗎?你有例外嗎?在那種情況下,你檢查了你的服務器日誌嗎? –
我的意思是,圖表不打印。只有句子「Cytoscape Web將用您的圖表替換此div的內容。」如果我將相同的文件保存爲html文件,一切正常,那麼根據javascript和jsp-files的結合,是否有一些限制? – bethlis