jQCloud无法正常工作

时间:2016-07-27 21:37:51

标签: jquery tag-cloud

我正在尝试实现jQCloud库,但是当我尝试使用它时,我的浏览器会显示

$(...).jQCloud is not a function

jqcloud的来源是https://github.com/lucaong/jQCloud/blob/master/jqcloud/jqcloud-1.0.4.min.js

页面代码(带django templatetag):

    {% load static %}
    <!doctype html public "lice">
    <head>
        <meta charset="utf-8">
        <title>jqcloud</title>
        <script type="text/javascript" src="{% static "home/jqcloud.js" %}"></script>
        <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>

    <script type="text/javascript">
    var word_list = [
       {text: "Lorem", weight: 15},
       {text: "Ipsum", weight: 9, link: "http://jquery.com/"},
       {text: "Dolor", weight: 6},
       {text: "Sit", weight: 7},
       {text: "Amet", weight: 5}
       // ...other words
    ];
    $(document).ready(function() {
       $("#wordcloud").jQCloud(word_list);
    });
    </script>
    </head>
    <body>
    <div id="wordcloud" style="width: 550px; height: 350px; position: relative;"></div>
    </body>
    </html>

1 个答案:

答案 0 :(得分:0)

你在它的依赖jQuery之前调用JQCloud库。