错误:javascript运行时错误 [英] Error: javascript runtime error

查看:105
本文介绍了错误:javascript运行时错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从datatable生成excel表。

这是我的HTML表格

 <  表格 >  
< thead >
< tr >
< th > 名称< / th >
< th > 职位< / th >
< th > Office < / th >
< th > 年龄< / th >
< th > 开始日期< / th >
< th > 薪水< / th >
< / tr >
< / thead >
< tfoot > ;
< tr >
< th > 名称< / th >
< th > 职位< / th >
< th > Office < / th >
< th > 年龄< / th >
< th > 开始日期< / th >
< th < span class =code-keyword>> 薪资< / th >
< / tr >
< / tfoot >
< tbody > < / tbody >
< / table >





这是我的Javascript



 $( document )。ready(  function (){
debugger ;
$(' #example')。dataTable({
dom:< span class =code-string>' Bfrtip'
按钮:[
' copy'' csv '' excel'' pdf'' print'
]
})

});





这是参考我添加到我的代码:

 <  链接    rel   = < span class =code-keyword> stylesheet    href   =  https://cdn.datatables.net/1.10.11/css/jquery.dataTables.min.css    /  >  
< link rel = stylesheet href = https://cdn.datatables.net/buttons/1.1.2/css/buttons.dataTables.min .css / >
< link href = 〜/ Content / Datatables / Css / dataTables.tableTools.css rel = 样式表 / >
< script src = https://code.jquery.com/jquery-1.12.0.min.js > < / script >
< script src = https://cdn.datatables.net/1.10.11/js/jquery.dataTables.min.js > < / script >
< script src = < span class =code-keyword>〜/ Scripts / DataTables / dataTables.tableTools.js > < / script >
< script < span class =code-attribute> src = https://cdn.datatables.net/buttons/1.1.2/js/dataTables.buttons.min.js > < / script >
< script src = https://cdn.datatables.net/buttons/1.1.2/js/buttons.flash.min.js > < / script >
< script src = https://cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js > < / script < span class =code-keyword>>
< script src = https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/pdfmake.min.js > < / script >
< script src = https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/vfs_fonts.js > < / script >
< script < span class =code-attribute> src = https://cdn.datatables.net/buttons/1.1.2/js/buttons.html5.min.js > < / script >
< script src = < span class =code-keyword> https://cdn.datatables.net/buttons/1.1.2/js/buttons.print.min.js > ; < / script >





但我得到的错误如下:'对象不支持属性或方法Datatable'



我尝试过:



我正在使用flash和Html5按钮生成excel表格此代码取自网站:

https://datatables.net/extensions/buttons/examples/initialisation/export.html

解决方案

document )。ready( function ( ){
调试器;

' #example')。dataTable({
dom:' Bfrtip'
按钮:[
' copy'' csv'' excel'' pdf'' print'
]
})

});





这里是我正在添加到我的代码中的引用:

 <   link     rel   =  stylesheet    href   =  https://cdn.datatables.net/1.10.11/css/jquery.dataTables.min.css    /  >  
< link rel = stylesheet href = https://cdn.datatables.net/buttons/1.1.2/css/buttons.dataTables .min.css / >
< link href = 〜/ Content / Datatables / Css / dataTables.tableTools.css rel = 样式表 / >
< script src = https://code.jquery.com/jquery-1.12.0.min.js > < / script >
< script src = https://cdn.datatables.net/1.10.11/js/jquery.dataTables.min.js > < / script >
< script src = < span class =code-keyword>〜/ Scripts / DataTables / dataTables.tableTools.js > < / script >
< script src = https://cdn.datatables.net/buttons/1.1.2/js/dataTables.buttons.min.js > < / script >
< script src = https://cdn.datatables.net/buttons/1.1.2/js/buttons.flash.min.js > < / script >
< sc ript src = https://cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js > < / script >
< script src = https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/pdfmake.min.js > < / script >
< 脚本 src = https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/vfs_fonts.js > < / script >
< script src = https://cdn.datatables.net/buttons/1.1.2/js/buttons.html5.min.js > < / script >
< script src = https://cdn.datatables.net/buttons/1.1.2/js/buttons.print.min.js > < / script >





但我得到的错误如下: '对象不支持属性或方法Datatable'



我尝试过:



我使用flash和Html5按钮生成excel表格此代码取自网站:

https://datatables.net/extensions/buttons/examples/initialisation/export.html


检查此行中的代码

 


I want to generate excel sheet from datatable.
Here is my HTML table

<table>
            <thead>
                <tr>
                    <th>Name</th>
                    <th>Position</th>
                    <th>Office</th>
                    <th>Age</th>
                    <th>Start date</th>
                    <th>Salary</th>
                </tr>
            </thead>
            <tfoot>
                <tr>
                    <th>Name</th>
                    <th>Position</th>
                    <th>Office</th>
                    <th>Age</th>
                    <th>Start date</th>
                    <th>Salary</th>
                </tr>
            </tfoot>
            <tbody></tbody>
</table>



Here is my Javascript

$(document).ready(function () {
    debugger;
     $('#example').dataTable({
            dom: 'Bfrtip',
       buttons: [
            'copy', 'csv', 'excel', 'pdf', 'print'
        ]
     })

});



Here is references I'm adding to my code:

<link rel="stylesheet" href="https://cdn.datatables.net/1.10.11/css/jquery.dataTables.min.css" />
    <link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.1.2/css/buttons.dataTables.min.css" />
    <link href="~/Content/Datatables/Css/dataTables.tableTools.css" rel="stylesheet" />
<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
    <script src="https://cdn.datatables.net/1.10.11/js/jquery.dataTables.min.js"></script>
    <script src="~/Scripts/DataTables/dataTables.tableTools.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.1.2/js/dataTables.buttons.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.1.2/js/buttons.flash.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js"></script>
    <script src="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/pdfmake.min.js"></script>
    <script src="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/vfs_fonts.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.1.2/js/buttons.html5.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.1.2/js/buttons.print.min.js"></script>



But I'm getting error like : 'Object doesn't support property or method Datatable'

What I have tried:

I'm generating excel sheet using flash and Html5 buttons this code taken from site :
https://datatables.net/extensions/buttons/examples/initialisation/export.html

解决方案

(document).ready(function () { debugger;


('#example').dataTable({ dom: 'Bfrtip', buttons: [ 'copy', 'csv', 'excel', 'pdf', 'print' ] }) });



Here is references I'm adding to my code:

<link rel="stylesheet" href="https://cdn.datatables.net/1.10.11/css/jquery.dataTables.min.css" />
    <link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.1.2/css/buttons.dataTables.min.css" />
    <link href="~/Content/Datatables/Css/dataTables.tableTools.css" rel="stylesheet" />
<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
    <script src="https://cdn.datatables.net/1.10.11/js/jquery.dataTables.min.js"></script>
    <script src="~/Scripts/DataTables/dataTables.tableTools.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.1.2/js/dataTables.buttons.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.1.2/js/buttons.flash.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js"></script>
    <script src="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/pdfmake.min.js"></script>
    <script src="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/vfs_fonts.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.1.2/js/buttons.html5.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.1.2/js/buttons.print.min.js"></script>



But I'm getting error like : 'Object doesn't support property or method Datatable'

What I have tried:

I'm generating excel sheet using flash and Html5 buttons this code taken from site :
https://datatables.net/extensions/buttons/examples/initialisation/export.html


Check your code in this line


这篇关于错误:javascript运行时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆