无法找到table2excel

时间:2017-01-10 15:40:06

标签: javascript jquery html

我得到table2excel"找不到功能"错误。

为什么找不到它?

Alamofire.request(mapsUrl).responseJSON(completionHandler: { (response) in
    let jsonObject = JSON(response.result.value)
    let value = jsonObject["rows"][0]["elements"][0]["distance"]["value"].int

    var converted = 0
    if value! <= 5000{
        converted = (value! / 1000) * 80
    }else{
        converted = (value! / 1000) * 65
    }
    if converted < 400{
        converted = 400
    }else if converted == 0{
        converted = 400
    }
    d = converted
    print(d)
})

在回调中:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> 

<script src="https://cdn.rawgit.com/unconditional/jquery-table2excel/master/src/jquery.table2excel.js"></script>



   <table class="table" id="table2excel">
        <thead>
            <tr class="noExl">
                <th>#</th>
                <th>Column heading</th>
                <th>Column heading</th>
                <th>Column heading</th>
            </tr>
            <tr>
                <th>#</th>
                <th>Column heading</th>
                <th>Column heading</th>
                <th>Column heading</th>
            </tr>
        </thead>
        <tbody>
            <tr class="active">
                <td>1</td>
                <td>Column content</td>
                <td>Column content</td>
                <td>Column content</td>
            </tr>
            <tr>
                <td>2</td>
                <td>Column content</td>
                <td>Column content</td>
                <td>Column content</td>
            </tr>

        </tbody>
    </table>
</div>

0 个答案:

没有答案