简单地说内联标签永远不会被云取代
我从文件夹中加载了我的 JS(已确认链接)
<script type="text/javascript" src="/jquery/jqquery-1.7.2.js"></script>
<script type="text/javascript" src="/jquery/jqcloud-1.0.1.js"></script>
<link rel="stylesheet" href="/jquery/jqcloud.css" type="text/css" media="screen">
然后我使用一些 PHP 来生成标签数组
<script type="text/jscript">
var word_list = [
<?
foreach ($array as $key => $value) {
if ($value == $average) { $weight = 2;}
else if ($value > $average) { $weight = 3;}
else if ($value < $average) { $weight = 1;}
if (strlen($key) > 1 ){
echo "{text: \"".$key."\", weight:".$weight.", url: \"http://myurl.com/tags/".$key."\", title: \"".$value."\"}";
$total -= 1;
if ($total == 0) echo ",";
}
}
?>
];
$(document).ready(function() {
$("#wordcloud").jQCloud(word_list);
});
然而,我的标签部分只有一个空 div