DataTables:Uncaught TypeError:无法读取未定义的属性“错误”

Here's my HTML:

<table id="mens-clubs" class="display" cellspacing="0" role="grid" data-page-length="50">
            <th width="0">ID</th>
            <th width="20%">Club</th>
            <th width="20%">City</th>
            <th width="20%">State</th>
            <th width="20%">Metro</th>
            <th width="20%">Union</th>
            <th width="0">ID</th>
            <th width="20%">Club</th>
            <th width="20%">City</th>
            <th width="20%">State</th>
            <th width="20%">Metro</th>
            <th width="20%">Union</th>

Here's my JS:

$(document).ready(function() {
        'ajax': {
            'url': '/my/data/path/src.php',
            'dataSrc': 'data'
        'columns': [
            { 'data': 'id' },
            { 'data': 'clubName' },
            { 'data': 'city' },
            { 'data': 'state' },
            { 'data': 'metroArea' },
            { 'data': 'unionName' }
        'processing': true,
        'dom': '<"row"<"small-24 column"B>><"row"<"large-8 columns"<"row filter-wrapper"<"columns small-24"f>>><"large-16 columns right"p>>' + 't' + '<"row"<"small-24 columns"p>>',
        'buttons': [ 'copy', 'excel', 'csv', 'pdf', 'print' ],
        'searching': true,
        'language': {
            'search': '',
            'searchPlaceholder': 'Search Clubs'
        'pagingType': 'full_numbers',
        'scrollY': '50vh',
        'scrollCollapse': true,
        'deferRender': true

Here are the contents of my src.php file:

  "data": [{
    "id": "3",
    "clubName": "Alpha Steelers",
    "city": "Alpha",
    "state": "UT",
    "metroArea": "",
    "unionName": "Rocky Mountain"
  }, {
    "id": "5",
    "clubName": "Beta of Aspen",
    "city": "Beta",
    "state": "CO",
    "metroArea": "",
    "unionName": "Rocky Mountain"
  }, {
    "id": "6",
    "clubName": "Gamma Highlanders",
    "city": "Gamma",
    "state": "CO",
    "metroArea": "",
    "unionName": "Rocky Mountain"

My data file is successfully retrieved via GET every time, however, I get this error immediately following it's successful retrieval:

Uncaught TypeError: Cannot read property 'error' of undefined

The line the error references inside DataTables.js is 79406. It is inside the _fnBuildAjax() function and is as follows:

enter image description here

Has anyone ever come across this error or have any idea what this error is referring to? I've run my src.php file through JSONLinter and it is valid. Any help would be greatly appreciated.

doushaju4901 还不确定“错误”对象在参数列表中的位置,但通常最好使用HTTP状态代码和消息来传达错误,以便错误处理程序可以处理它。(要记住的事情)。当你必须在“成功”处理程序中检查“错误”消息时,我总觉得很奇怪。看似矛盾。
3 年多之前 回复
dongyi3776 抱歉,在工作中遇到紧急时间,并且没有在stackoverflow上。将您的成功处理函数更改为:“function(data,...){...}”“...”部分是您的参数集合和函数定义的其余部分。“Arguments[0]”只是函数定义中的第一个参数。所以在那之后你只需要做“回调(数据)”,假设你在构造它时覆盖了DataTable设置中的内置ajax函数。
3 年多之前 回复
douqianmin5367 我很抱歉没有早点回复你。在我的控制台中,它返回Arguments[3],我的主数据对象是Argument[0].data。现在唯一的问题是我制作Arguments[0].data我的dataSrc值还是如何继续?
3 年多之前 回复
dousuitang5239 试试这个。在您的成功处理程序中:“console.log(arguments);”如果它们不在函数定义中,这将返回传递给even的所有参数。
3 年多之前 回复
duanlangwen9597 同样的错误:'ajax':{'url':'/my/data/path/src.php','dataSrc':'data','done':function(json){console.log(json);}
3 年多之前 回复
dongtuoao7987 文档没有告诉我我期望看到什么成功...你能尝试用“完成”代替“成功”吗?
3 年多之前 回复
duanqiang3925 当我运行它-'ajax':{'url':'/my/data/path/src.php','dataSrc':'data','success':function(json){console.log(json));它说未定义
3 年多之前 回复
douxing9813 您是否在成功通话中尝试过json上的console.log?
3 年多之前 回复


Your json feed is missing some info. Jquery will send down a "draw" number and that needs to be fed back. You need the total and filtered as well as the data.

$complete = array("draw" => $this->request->query['draw'],
            'recordsTotal' => $total,
            "recordsFiltered" => $filtered,
            "data" => $output);
doupin5408 同样的错误。 我的src.php文件如下所示:{“draw”:1,“recordsTotal”:3,“recordsFiltered”:3,“data”:[{“id”:“3”,“clubName”:“Alpha Steelers” ,“city”:“Alpha”,“state”:“UT”,“metroArea”:“”,“unionName”:“Rocky Mountain”},{“id”:“5”,“clubName”:“Beta” Aspen“,”city“:”Beta“,”state“:”CO“,”metroArea“:”“,”unionName“:”Rocky Mountain“},{”id“:”6“,”clubName“:” Gamma Highlanders“,”city“:”Gamma“,”state“:”CO“,”metroArea“:”“,”unionName“:”Rocky Mountain“}}}
3 年多之前 回复
Csdn user default icon
DataTable 报错: Uncaught TypeError: Cannot read property 'nTable' of null

DataTable 报错,如图: ![图片说明]( 请问是什么原因导致

错误:DataTables警告:table id = DataTables_table_0 - Ajax错误。 在Laravel

<div class="post-text" itemprop="text"> <p>I was using from a Laravel project well, But today, this error appears on one of the pages:</p> <blockquote> <p>Error: DataTables warning: table id=DataTables_table_0 - Ajax error. For more information about this error, please see <a href="" rel="nofollow noreferrer"></a></p> </blockquote> <p>The recourses codes:</p> <pre><code>@extends('') @section('title', getOption('app_name') . ' - Orders') @section('content') @php $status = $status ?? false; $dataURL = $status ? "/admin/orders-filter-ajax/$status/data" : "/admin/orders-ajax/data"; @endphp &lt;div class="row"&gt; &lt;div class="col-md-12" style="margin-bottom: 5px;"&gt; &lt;div class="btn-group"&gt; &lt;button type="button" class="btn btn-info btn-sm hide" id="apply-all"&gt;Apply&lt;/button&gt; &lt;/div&gt; &lt;div class="btn-group"&gt; &lt;a href="{{ url('/admin/orders/') }}" class="btn btn-default btn-sm btn btn-default btn-sm {{ $status == false ? 'active' : '' }}"&gt;ALL&lt;/a&gt; &lt;a href="{{ url('/admin/orders-filter/pending') }}" class="btn btn-default btn-sm {{ $status == 'pending' ? 'active' : '' }}"&gt;Pending&lt;/a&gt; &lt;a href="{{ url('/admin/orders-filter/inprogress') }}" class="btn btn-default btn-sm {{ $status == 'inprogress' ? 'active' : '' }}"&gt;In Progress&lt;/a&gt; &lt;a href="{{ url('/admin/orders-filter/completed') }}" class="btn btn-default btn-sm {{ $status == 'completed' ? 'active' : '' }}"&gt;Completed&lt;/a&gt; &lt;a href="{{ url('/admin/orders-filter/partial') }}" class="btn btn-default btn-sm {{ $status == 'partial' ? 'active' : '' }}"&gt;Partial&lt;/a&gt; &lt;a href="{{ url('/admin/orders-filter/refunded') }}" class="btn btn-default btn-sm {{ $status == 'refunded' ? 'active' : '' }}"&gt;Refunded&lt;/a&gt; &lt;a href="{{ url('/admin/orders-filter/cancelled') }}" class="btn btn-default btn-sm {{ $status == 'cancelled' ? 'active' : '' }} "&gt;Cancelled&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="row"&gt; &lt;div class="col-md-12"&gt; &lt;div class="panel panel-default"&gt; &lt;div class="panel-body"&gt; &lt;form id="frm-apply-all" action="{{ url('/admin/orders-bulk-update') }}" method="post"&gt; {{ csrf_field() }} &lt;/form&gt; &lt;div class="table-responsive"&gt; &lt;table class="table table-bordered mydatatable table-hover" style="width: 99.9%"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;&lt;input type="checkbox" class="input-sm checkbox-all"&gt;&lt;/th&gt; &lt;th&gt;@lang('general.order_id')&lt;/th&gt; &lt;th&gt;Api @lang('general.order_id')&lt;/th&gt; &lt;th&gt;@lang('general.user')&lt;/th&gt; &lt;th&gt;@lang('general.service')&lt;/th&gt; &lt;th&gt;@lang('general.package')&lt;/th&gt; &lt;th&gt;@lang('')&lt;/th&gt; &lt;th&gt;@lang('general.amount')&lt;/th&gt; &lt;th&gt;@lang('general.quantity')&lt;/th&gt; &lt;th&gt;@lang('general.start_counter')&lt;/th&gt; &lt;th&gt;@lang('general.remains')&lt;/th&gt; &lt;th&gt;@lang('general.status')&lt;/th&gt; &lt;th&gt;@lang('')&lt;/th&gt; &lt;th class="text-center" width="5%"&gt;@lang('general.action')&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;/table&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; @endsection @push('scripts') &lt;script&gt; $(function () { $('.mydatatable').DataTable({ processing: true, serverSide: true, pageLength: 25, order: [[1, 'desc']], ajax:'{!! url($dataURL) !!}', columns: [ {data: 'bulk', name: 'bulk', orderable: false, searchable: false}, {data: 'id', name: 'id'}, {data: 'api_order_id', name: 'api_order_id'}, {data: '', name: ''}, {data: '', name: ''}, {data: '', name: ''}, {data: 'link', name: 'link'}, {data: 'price', name: 'price', sortable: false, searchable: false}, {data: 'quantity', name: 'quantity', sortable: false, searchable: false}, {data: 'start_counter', name: 'start_counter', sortable: false, searchable: false}, {data: 'remains', name: 'remains', sortable: false, searchable: false}, {data: 'status', name: 'status'}, {data: 'created_at', name: 'created_at'}, {data: 'action', name: 'action', orderable: false, searchable: false}, ] }); $(document).on('click', '.checkbox-all', function () { $('.row-checkbox').trigger('click'); $('#apply-all').removeClass('hide'); }); $(document).on('click', '.row-checkbox', function () { $('#apply-all').removeClass('hide'); var t = $(this); if (':checked')) { t.parents('tr').find('.row-edit').removeAttr('readonly'); t.parents('tr').attr('style', 'background-color:#dedede'); } else { t.parents('tr').find('.row-edit').attr('readonly', 'readonly'); t.parents('tr').removeAttr('style'); } }); $('#apply-all').on('click', function (e) { var form = $('#frm-apply-all'); var isAnyRowSelected = false; // check if it shouldn't submit empty form bootbox.confirm({ message: "Confirm to apply bulk update?", buttons: { cancel: { label: 'Cancel', className: 'btn-default' }, confirm: { label: 'Confirm', className: 'btn-primary' }, }, callback: function (result) { if (result) { // Iterate over all checkboxes in the table $('.row-checkbox').each(function () { var t = $(this); if (':checked')) { isAnyRowSelected = true; // Row selected // Order id $(form).append( $('&lt;input&gt;') .attr('type', 'hidden') .attr('name', t.attr('name')) .val(t.val()) ); // start count $(form).append( $('&lt;input&gt;') .attr('type', 'hidden') .attr('name', 'start_counter[' + t.val() + ']') .val($('input[name="start_counter[' + t.val() + ']"]').val()) ); // remains $(form).append( $('&lt;input&gt;') .attr('type', 'hidden') .attr('name', 'remains[' + t.val() + ']') .val($('input[name="remains[' + t.val() + ']"]').val()) ); // status $(form).append( $('&lt;input&gt;') .attr('type', 'hidden') .attr('name', 'status[' + t.val() + ']') .val($('select[name="status[' + t.val() + ']"]').find(':selected').text()) ); } }); if (isAnyRowSelected) { form.submit(); } } } }); }); }); &lt;/script&gt; @endpush </code></pre> <p>I didn't change any thing in my project today It worked yesterday well:(</p> </div>

Datatables warning:table id


DataTables警告:无法解析来自服务器的JSON数据。 这是由JSON格式错误引起的

<div class="post-text" itemprop="text"> <p>I am using server-side DataTables in a project</p> <p>and do a search, shows me the following error message:</p> <p><code>DataTables warning: JSON data from server not could be parsed. This is Caused by a JSON formatting error.</code></p> <p>I found some suggestions in the forums but nothing has worked for me</p> <p>Anyone have any suggestions?</p> </div>


<div class="post-text" itemprop="text"> <p>I'm using <a href="" rel="nofollow noreferrer"></a> currently to send ajax request for my datatable but noticed this:</p> <pre><code>columns: [ { data: 'first_name' }, { data: 'last_name' }, { data: 'email' }, ] </code></pre> <p>but those are lines in my javascript document. I'm currently providing data like this:</p> <pre><code>return Datatables::of(User::all())-&gt;make(true); </code></pre> <p>That means if someone change lines in my js file he can view columns that he is not supposed to. Now if you take a look at github documentation you can see that this package can also accept collection or query. Is it possible to target only certain columns from database with collection or query ? </p> </div>

PHP / Datatables:数字按文本排序

<div class="post-text" itemprop="text"> <p>I am using Datatables to style a table that I fill with PHP. </p> <p>Everything works as intended except for a column containing amounts. If I click on the Datatables column header for this column in order to sort the table by this column it sorts it but only as text instead of numbers so that 20 appears before 3 etc. </p> <p>Is there a way I can prevent this in PHP by changing the format ?</p> <p><strong>Example cell:</strong> </p> <pre><code>&lt;td class="colAmount ralign"&gt;&lt;?php echo number_format(doubleval($requests-&gt;amount), 2, ".", ","); ?&gt;&lt;/td&gt; </code></pre> <p>If an amount in my database ($requests-&gt;amount) is e.g. 100000 then the above would format this as 100,000.00 as I need to display it with the thousands and decimal separators - this is then probably interpreted as text. </p> <p>Many thanks in advance, Tim. </p> </div>


<div class="post-text" itemprop="text"> <p>First of all its not about filtering(searching) of drop-down.</p> <p>I am using <a href="" rel="nofollow">Datatables</a> : where one of my column has drop-down , i want when i change or select any option from it ... its should pass to it resp value </p> <pre><code>$(document).ready(function () { dt = $('#example').DataTable({ "pagingType": "full_numbers", "scrollY": "440px", "scrollX": "100%", "scrollCollapse": true, "bProcessing": true, "bServerSide": true, "sAjaxSource": "/server_processing.php", "deferRender": true, "aoColumns": [{ className: "center", "class": "details-control", "orderable": false, "data": null, "defaultContent": "", }, { className: "center", }, { className: "center", }, { className: "center", }, { className: "center", }, { className: "center", }, { className: "center", }, ], "columnDefs": [{ "aTargets": [7], "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) { $(nTd).css('text-align', 'center'); }, "mData": null, "mRender": function (data, type, full) { return '&lt;td&gt;&lt;select id="dynamic_select" name="dynamic_select"&gt; \ &lt;option id="0" value=""&gt;Select&lt;/option/&gt; \ &lt;option id="1" value="test.php"&gt;1&lt;/option/&gt; \ &lt;option id="2" value="test2.php"&gt;13&lt;/option/&gt; \ &lt;option id="31" value="test3.php"&gt;12&lt;/option/&gt; \ &lt;/select&gt;&lt;/td&gt;'; } }] }); $('select[name=dynamic_select]').on('change', function () { var attvalue = $(this).children(":selected").attr("id"); var mainval = $(this).val(); var url = mainval; if ($(this).children(":selected").attr("id") == 0) { } else if ($(this).children(":selected").attr("id") == 1) {, "_self"); } else {, "_self"); } return false; }); }); </code></pre> <p>below is my HTML</p> <pre><code> &lt;table id="example" class="display" cellspacing="0" width="100%"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;&lt;/th&gt; &lt;th&gt;First name&lt;/th&gt; &lt;th&gt;Last name&lt;/th&gt; &lt;th&gt;Position&lt;/th&gt; &lt;th&gt;Office&lt;/th&gt; &lt;th&gt;Start date&lt;/th&gt; &lt;th&gt;Salary&lt;/th&gt; &lt;th&gt;&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tfoot&gt; &lt;tr&gt; &lt;th&gt;&lt;/th&gt; &lt;th&gt;First name&lt;/th&gt; &lt;th&gt;Last name&lt;/th&gt; &lt;th&gt;Position&lt;/th&gt; &lt;th&gt;Office&lt;/th&gt; &lt;th&gt;Start date&lt;/th&gt; &lt;th&gt;Salary&lt;/th&gt; &lt;th&gt;&lt;/th&gt; &lt;/tr&gt; &lt;/tfoot&gt; &lt;/table&gt; </code></pre> <p>All is working fine ... just on change of select value .. i need it should go to <strong><em>resp. Url with its resp. id</em></strong> </p> <p>Also can i define each row a unique id ( or my database primary id ) ? </p> <p>Note : if i put above jquery in my simple PHP then its working .. but don't know why its not working in data-tables </p> <p>Please help me</p> </div>

jQuery DataTables:POST Server Side JSON输出的问题

<div class="post-text" itemprop="text"> <p>I am trying to get my datatable to take a POST JSON output from my server.</p> <p>This is my client side code:</p> <pre><code>&lt;script&gt; $(document).ready(function() { $('#example').dataTable( { "bProcessing": true, "bServerSide": true, "sAjaxSource": "http://localhost/staff/jobs/my_jobs", "fnServerData": function ( sSource, aoData, fnCallback ) { $.ajax( { "dataType": 'json', "type": "POST", "url": sSource, "data": aoData, "success": fnCallback } ); } } ); } ); &lt;/script&gt; </code></pre> <p>Now I have copied and pasted the server side code found in the DataTables examples found <a href="" rel="nofollow noreferrer">here</a>.</p> <p>When I change my sAjaxSource to view this page the table doesn't move beyond 'processing'.</p> <p>When I view the JSON directly I see this output.</p> <pre><code>{"sEcho": 1, "iTotalRecords": 1, "iTotalDisplayRecords": 1, "aaData": [ ["Trident","First Ever Job"]] } </code></pre> <p>Just for fun I went to the POST server-side example and copied some of the JSON they are using for their example and just PHP echoed it straight out of another page.</p> <p>This is the output of that page.</p> <pre><code>{"sEcho": 1, "iTotalRecords": 1, "iTotalDisplayRecords": 1, "aaData": [ ["Trident","Internet Explorer 4.0"]] } </code></pre> <p>Here is where it gets interesting.</p> <p>The JSON that has been processed by the server fails to work yet the JSON simply echo'd by the same server on a different page does work... yet both are identical in outputs.</p> <p>I hope someone can shed some light on this because as the tree said to the lumberjack... I'm stumped.</p> <p>Thanks,</p> <p>Tim </p> </div>

使用PHP ECHO填充时,DataTables子行无法正确显示

<div class="post-text" itemprop="text"> <p>I have looked at all the examples I can find but haven't found an answer to this.</p> <p>I have a DataTables table which is loaded by PHP echos, after manipulating data from MySQL queries.</p> <p>I now want to add child rows showing extra data, basically the same format type as the DataTables examples (<a href="" rel="nofollow noreferrer"></a>) </p> <p>I have modified the table by adding an extra <code>&lt;tr&gt;</code>, and have added the details-control class (Simplified code below)</p> <pre><code>&lt;tbody&gt; &lt;?php while($fetch = $query-&gt;fetch_array()) { /* processing to build 15 variables used as data in main row &lt;td&gt;s and 8 variables used in the "hidden" rows */ echo '&lt;tr id = "parent"&gt;'; echo '&lt;td class="details-control"&gt;&lt;/td&gt;'; /* taken from the DT example */ echo '&lt;td&gt;'.$MainVariable.'&lt;/td&gt;'; /* repeated for all 15 of the main row variables */ echo '&lt;/tr&gt;'; /* Now this should be the child row */ echo '&lt;tr id="child"&gt;'; echo '&lt;td colspan="5"&gt;'; echo 'Text: &lt;b&gt;'.$ChildVariable.'&lt;/b&gt;&lt;br /&gt;'; /* repeated for 6 of the child row variables */ echo '&lt;/td&gt;'; echo '&lt;td colspan="5"&gt;'; echo 'Text: &lt;b&gt;'.$ChildVariable.'&lt;/b&gt;&lt;br /&gt;'; /* repeated for remaining 2 of the child row variables */ echo '&lt;/td&gt;'; echo '&lt;td colspan="5"&gt;'; /* reserved for possibly more data */ echo '&lt;/td&gt;'; echo '&lt;/tr&gt;'; } ?&gt; &lt;/tbody&gt; </code></pre> <p>The Javascript I have tried is below</p> <pre><code>$(document).ready(function() { // Add event listener for opening and closing details $('#attendtbl').on('click', 'td.details-control', function () { var tr = $(this).closest('tr'); var row = table.row(tr); if (row.child.isShown()) { // This row is already open - close it row.child.hide(); tr.removeClass('shown'); } else { // Open this row row.child(format('child-value'))).show(); tr.addClass('shown'); } }); }); </code></pre> <p>This shows all the data correctly, but all the child are shown displayed when the table loads, and the on('click' doesn't work.</p> <p>Looking at all the DataTables examples I can find all the data seems to be loaded by Javascript/AJAX. which is something I don't really want to do.</p> <p>I assume there must be a Javasript fault, but this is a new area for me.</p> </div>

Cannot read property 'length' of undefined问题

这是前台报的错误 sql我执行了有数据 ``` Uncaught TypeError: Cannot read property 'options' of null at replaceSelect (select_ui.js:917) at addSelect (select_ui.js:771) at initAllSelectUi (select_ui.js:728) at init ( at wrappedFn (yahoo-dom-event.js:135) ``` 应该是js哪个属性名错了把 这是js ``` function queryTask(){ YAHOO.util.Dom.setStyle("taskCont0","display","none"); YAHOO.util.Dom.get("content0_message").innerHTML="<h2 class='default' onClick=\"ExChgClsName(this,'task0')\">员工信息</h2>"; YAHOO.util.Dom.setStyle("taskCont0","display",""); executeQuery(1,10); } //init on load YAHOO.util.Event.addListener(window,'load',init); ```


<div class="post-text" itemprop="text"> <p>i want to reload data in datatables after i delete it using ajax. i checked the database and the item was deleted,but datatables won't refresh and it returns this error </p> <blockquote> <p>Uncaught TypeError: Cannot set property 'data' of null datatables laravel</p> </blockquote> <p>also, i got this message from the alert</p> <blockquote> <p>DataTables warning: table id=table1 - Invalid JSON response. For more information about this error, please see <a href="" rel="nofollow noreferrer"></a></p> </blockquote> <p>this is the code : </p> <p>jquery : </p> <pre><code>var tab= jQuery('#table1').DataTable({ "columns": [ null, null, null, { "width": "15%" } ] }); function getPageData() { jQuery.ajax({ url: 'attend/f', type: 'GET', success: function(data){ tab.ajax.reload(); } }); } jQuery(".btndelete").click(function(e){ jQuery.ajaxSetup({ headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' } }); var id= jQuery(this).data('id'); e.preventDefault(); swal({ title: 'Are you sure?', text: "You won't be able to revert this!", type: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'Yes, delete it!' }).then(function () { jQuery.ajax({ dataType: 'json', type: 'delete', url: 'attend/' + id + '/delete', }).done(function(data){ getPageData(); }); }) }); </code></pre> <p>route : </p> <pre><code>public function attend1($id) { $acara = \App\Model\MyEventList::where('id_user',$id)-&gt;get(); return response()-&gt;json(); } </code></pre> </div>

DataTables,数据库服务器端处理和“DataTables warning(table id ='example')”

<div class="post-text" itemprop="text"> <p>There are many peoples experiencing the following error with DataTables and server side processing with Ajax, but I've tried many of them and read all, without any success.</p> <blockquote> <p>DataTables warning (table id = 'example') - Invalid JSON response</p> </blockquote> <p>I've also checked dev answers and they say that every time you that error is because you have or a json formatting problem, or a database connection problem or a column selection problem. Well it seems to me I have none of them.</p> <p>My code (got from this example: <a href="" rel="nofollow noreferrer">here</a>) is (try.php):</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""&gt; &lt;html xmlns=""&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt; &lt;!-- DataTables CSS --&gt; &lt;link rel="stylesheet" type="text/css" href="//"&gt; &lt;script type="text/javascript" charset="utf8" src=""&gt;&lt;/script&gt; &lt;title&gt;test&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;table id="example"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;ID&lt;/th&gt; &lt;th&gt;country Name&lt;/th&gt; &lt;th&gt;country Currency&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;script type="text/javascript" charset="utf8" src=""&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function() { $('#example').dataTable( { "bProcessing": true, "bServerSide": true, "sAjaxSource": "server_processing2.php" } ); } ); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>And here is server_processing2.php:</p> <pre><code> &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""&gt; &lt;html xmlns=""&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt; &lt;title&gt;Processing&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;?php /* * Script: DataTables server-side script for PHP and MySQL * Copyright: 2010 - Allan Jardine * License: GPL v2 or BSD (3-point) */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Easy set variables */ /* Array of database columns which should be read and sent back to DataTables. Use a space where * you want to insert a non-database field (for example a counter or static image) */ $aColumns = array('ID', 'country_Name', 'country_Currency' ); /* Indexed column (used for fast and accurate table cardinality) */ $sIndexColumn = "ID"; /* DB table to use */ $sTable = "CountryInfos"; /* Database connection information */ $gaSql['user'] = "..."; $gaSql['password'] = "..."; $gaSql['db'] = "..."; $gaSql['server'] = "..."; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * If you just want to use the basic configuration for DataTables with PHP server-side, there is * no need to edit below this line */ /* * MySQL connection */ $gaSql['link'] = mysql_pconnect( $gaSql['server'], $gaSql['user'], $gaSql['password'] ) or die( 'Could not open connection to server' ); mysql_select_db( $gaSql['db'], $gaSql['link'] ) or die( 'Could not select database '. $gaSql['db'] ); /* * Paging */ $sLimit = ""; if ( isset( $_GET['iDisplayStart'] ) &amp;&amp; $_GET['iDisplayLength'] != '-1' ) { $sLimit = "LIMIT ".mysql_real_escape_string( $_GET['iDisplayStart'] ).", ". mysql_real_escape_string( $_GET['iDisplayLength'] ); } /* * Ordering */ if ( isset( $_GET['iSortCol_0'] ) ) { $sOrder = "ORDER BY "; for ( $i=0 ; $i&lt;intval( $_GET['iSortingCols'] ) ; $i++ ) { if ( $_GET[ 'bSortable_'.intval($_GET['iSortCol_'.$i]) ] == "true" ) { $sOrder .= $aColumns[ intval( $_GET['iSortCol_'.$i] ) ]." ".mysql_real_escape_string( $_GET['sSortDir_'.$i] ) .", "; } } $sOrder = substr_replace( $sOrder, "", -2 ); if ( $sOrder == "ORDER BY" ) { $sOrder = ""; } } /* * Filtering * NOTE this does not match the built-in DataTables filtering which does it * word by word on any field. It's possible to do here, but concerned about efficiency * on very large tables, and MySQL's regex functionality is very limited */ $sWhere = ""; if ( $_GET['sSearch'] != "" ) { $sWhere = "WHERE ("; for ( $i=0 ; $i&lt;count($aColumns) ; $i++ ) { $sWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string( $_GET['sSearch'] )."%' OR "; } $sWhere = substr_replace( $sWhere, "", -3 ); $sWhere .= ')'; } /* Individual column filtering */ for ( $i=0 ; $i&lt;count($aColumns) ; $i++ ) { if ( $_GET['bSearchable_'.$i] == "true" &amp;&amp; $_GET['sSearch_'.$i] != '' ) { if ( $sWhere == "" ) { $sWhere = "WHERE "; } else { $sWhere .= " AND "; } $sWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string($_GET['sSearch_'.$i])."%' "; } } /* * SQL queries * Get data to display */ $sQuery = " SELECT SQL_CALC_FOUND_ROWS ".str_replace(" , ", " ", implode(", ", $aColumns))." FROM $sTable $sWhere $sOrder $sLimit "; $rResult = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error()); /* Data set length after filtering */ $sQuery = " SELECT FOUND_ROWS() "; $rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error()); $aResultFilterTotal = mysql_fetch_array($rResultFilterTotal); $iFilteredTotal = $aResultFilterTotal[0]; /* Total data set length */ $sQuery = " SELECT COUNT(".$sIndexColumn.") FROM $sTable "; $rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error()); $aResultTotal = mysql_fetch_array($rResultTotal); $iTotal = $aResultTotal[0]; /* * Output */ $output = array( "sEcho" =&gt; intval($_GET['sEcho']), "iTotalRecords" =&gt; $iTotal, "iTotalDisplayRecords" =&gt; $iFilteredTotal, "aaData" =&gt; array() ); while ( $aRow = mysql_fetch_array( $rResult ) ) { $row = array(); for ( $i=0 ; $i&lt;count($aColumns) ; $i++ ) { if ( $aColumns[$i] == "version" ) { /* Special output formatting for 'version' column */ $row[] = ($aRow[ $aColumns[$i] ]=="0") ? '-' : $aRow[ $aColumns[$i] ]; } else if ( $aColumns[$i] != ' ' ) { /* General output */ $row[] = $aRow[ $aColumns[$i] ]; } } $output['aaData'][] = $row; } echo json_encode( $output ); ?&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Any try I've done, returned me that error but here is ARRAY I receive from server_processing2.php:</p> <pre><code> {"sEcho":0, "iTotalRecords":"287", "iTotalDisplayRecords":"287", "aaData":[ ["10768","Western Sahara","EH"],["10767","Vietnam","VND"], ["10765","Uzbekistan","UZS"],["10766","Venezuela","VEF"], ["10764","USA","USD"],["10763","Uruguay","UYU"],["10762","United Kingdom","GBP"], ["10761","United Arab Emirates","AED"],["10760","Ukraine","UAH"], ["10759","Uganda","UGX"],["10758","Turkmenistan","TMT"],......... ["10546","Argentina","ARS"],["10545","Albania","ALL"], ["10544","Afghanistan","AFN"] ] } </code></pre> <p>So I can assume that:</p> <ul> <li>my database works correctly (data is correct);</li> <li>JSON is well formatted (tested by JSON validator);</li> <li>data arrived to try.php (trunked after some results, but I guess is because DataTable works with 10 results a time...</li> </ul> <p>So why it doesn't work?</p> <p><strong><em>UPDATE</em></strong></p> <p>It works. There were (I guess) two problems:</p> <ol> <li>I needed to update DataTables to last versions</li> <li>As suggested I needed to eliminate html part from server side file.</li> </ol> </div>

jQuery dataTable()报错

本人新手,在用jQuery的dataTable()的时候遇到一点小问题。 在对一个用js操作dom对象拼成的表格使用dataTable()方法时报错。 jquery.dataTables.js:6581 Uncaught TypeError: Cannot read property 'asSorting' of undefined. 其他表格显示结果正常。求解 ![图片说明](


<div class="post-text" itemprop="text"> <p><strong>this my controller</strong></p> <pre><code>if ($request-&gt;ajax()) { $fields = Field::select(['id_lapangan','nama_lapangan','harga_sewa','gambar']); return Datatables::of($fields) // -&gt;addColumn('action', function($field){ // return view('datatable._action', [ // 'model' =&gt;$field, // 'form_url'=&gt;route('field.destroy', $field-&gt;id), // 'edit_url'=&gt;route('field.edit',$field-&gt;id), // 'confirm_message'=&gt;'yakin mau hapus'.$field-&gt;name .'?' // ]); // }) -&gt;make(true); } $html = $htmlBuilder -&gt;addColumn(['data'=&gt;'id_lapangan','name'=&gt;'id_lapangan','title'=&gt;'No.']) -&gt;addColumn(['data'=&gt;'nama_lapangan','name'=&gt;'nama_lapangan','title'=&gt;'Nama Lapangan']) -&gt;addColumn(['data'=&gt;'harga_sewa','name'=&gt;'harga_sewa','title'=&gt;'Harga Sewa']) -&gt;addColumn(['data'=&gt;'gambar','name'=&gt;'gambar','title'=&gt;'Gambar']) -&gt;addColumn(['data'=&gt; 'action' , 'name' =&gt; 'action' , 'title' =&gt; '' , 'orderable' =&gt;false , 'searchable' =&gt; false ]); return view('fields.index')-&gt;with(compact('html')); </code></pre> <p><strong>this my index.blade.php</strong></p> <pre><code>@extends('') @section('content') &lt;div class="container"&gt; &lt;div class="row"&gt; &lt;div class="col-md-12"&gt; &lt;ul class="breadcrumb"&gt; &lt;li&gt;&lt;a href="{{ url('/home') }}"&gt;Dashboard&lt;/a&gt;&lt;/li&gt; &lt;li class="active"&gt;Jadwal&lt;/li&gt; &lt;/ul&gt; &lt;div class="panel panel-default"&gt; &lt;div class="panel-heading"&gt; &lt;h2 class="panel-title"&gt;Lapangan&lt;/h2&gt; &lt;/div&gt; &lt;div class="panel-body"&gt; {!! $html-&gt;table(['class'=&gt;'table-striped table-bordered']) !!} &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; @endsection @section('scripts') {!! $html-&gt;scripts() !!} @endsection </code></pre> <p>When I run on my browser, the data in the database does not appear, and the eror is <strong>TypeError: f is undefined</strong></p> </div>

jQuery扩展可能冲突了 你这个坏人还我的方法 /(ㄒoㄒ)/~~!

**【发现CSDN大坑比,竟然评论出错~ 俺的QQ:980581089 邮箱也是这个 你懂得~ 唉 心累】** 项目中有需要图片浏览的一个需求,然后在网上找到一个很棒的工具 叫做viewer.js [GitHub地址]( "") 很容易就集成到项目中了,但是突然发现网页中左侧的菜单不能折叠了。。。 到项目中看了下,发现菜单控制用的是两个js文件,一个叫做sb-admin-2.js 代码如下: ``` $(function() { $('#side-menu').metisMenu(); }); //Loads the correct sidebar on window load, //collapses the sidebar on window resize. // Sets the min-height of #page-wrapper to window size $(function() { $(window).bind("load resize", function() { topOffset = 50; width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width; if (width < 768) { $('div.navbar-collapse').addClass('collapse'); topOffset = 100; // 2-row-menu } else { $('div.navbar-collapse').removeClass('collapse'); } height = ((this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height) - 1; height = height - topOffset; if (height < 1) height = 1; if (height > topOffset) { $("#page-wrapper").css("min-height", (height) + "px"); } }); var url = window.location; var element = $('ul.nav a').filter(function() { return this.href == url || url.href.indexOf(this.href) == 0; }).addClass('active').parent().parent().addClass('in').parent(); if ('li')) { element.addClass('active'); } }); ``` 一个叫做metisMenu.js[GitHub地址]( "") 然后谷歌浏览器调试js 提示_ sb-admin-2.js:3 Uncaught TypeError: $(...).metisMenu is not a function_ 说metisMenu不是个方法,然而在metisMenu中有这么一个方法: ``` var pluginName = "metisMenu"; $.fn[pluginName] = function(options) { this.each(function () { var el = $(this); if ( {; }, new Plugin(this, options)); }); return this; }; ``` 不懂什么意思,就查了下语法 说是添加一个jQuery 对象的扩展方法。显然之前是没问题的,加了viewer.js这个文件后这个扩展给搞没了或者是什么的。 是不是viewer.js中有某些东西把外部js文件中对jQuery的扩展给取消了? 对js不太熟悉,跪求路过的各位仙家指点迷津,不胜感激!

DataTables警告:table id = DataTables_Table_0 - 第0行请求的未知参数“4”

<div class="post-text" itemprop="text"> <p>I have a problem for a long time. I use a web template for my developments and I often have this error on some pages where I have to display tables, for example: <code>DataTables warning: table id = DataTables_Table_0 - Requested unknown parameter '4' for row 0</code> for this code : </p> <p></p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="panel panel-flat"&gt; &lt;table class="table table-bordered table-hover datatable-highlight table-striped"&gt; &lt;thead&gt; &lt;tr class="bg-green-600"&gt; &lt;th class="text-bold" width="40px"&gt;Codes&lt;/th&gt; &lt;th class="text-bold"&gt;Libelle&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;?php // Cas sélection compte bancaire $sql = "SELECT CODE_CIB, DESCRIPTION_CIB FROM CODES_INTERBANCAIRES ORDER BY CODE_CIB"; $req = $DB-&gt;query($sql); while ($d = $req-&gt;fetch()) { ?&gt; &lt;tr&gt; &lt;td&gt;&lt;?php echo $d['CODE_CIB']; ?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo $d['DESCRIPTION_CIB']; ?&gt;&lt;/td&gt; &lt;/tr&gt; &lt;?php } ?&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt;</code></pre> </div> </div> <p>I read the recommendations made on this error but I do not see any error that I could make. I specify that on other pages it works perfectly well and on other launch I have this error and when I click on the button ok the page is displayed. Thank you for your help.</p> </div>

将导出按钮组添加到yajra datatable laravel包

<div class="post-text" itemprop="text"> <p>I am using <a href="" rel="nofollow noreferrer">yajra laravel datatables</a> package version <strong>6.0</strong> and I want to add export button group But I do not know how can I implement that.</p> <p>Suppose I have a <code>SubscriberController</code> class like this :</p> <pre><code>public function newsletterDatatable (Request $request) { $subscribers = Subscriber::select(['sub_id', 'email', 'confirmed', 'created_at']); $datatable = app('datatables')-&gt;of($subscribers) -&gt;orderBy('created_at', 'desc') -&gt;addColumn('checkbox', '&lt;input type="checkbox" name="item_id[]" value="{{$sub_id}}"&gt;'); return $datatable-&gt;make(true); } </code></pre> <p>And in JS codes I have :</p> <pre><code>$('#allSubscribersTable').DataTable({ processing: true, serverSide: true, "bSort": false, "responsive": true, dom: 'Bfrtip', buttons: [ 'copy', 'csv', 'excel', 'pdf', 'print' ], ajax: { url: '{!! route('admin.newsletterDatatable') !!}' }, columns: [ {data: 'checkbox', "width": "20px"} ] }); </code></pre> <p>As you can see I used <code>buttons</code> option on DataTable initialization but when table is shown there are not any export buttons.</p> <p>On the <a href="" rel="nofollow noreferrer">buttons-export</a> page on Docs is said that I should add below Code But I do not know where and how to use in my controller :</p> <pre><code>namespace App\DataTables; use App\User; use Yajra\Datatables\Services\DataTable; class UsersDataTable extends DataTable { //...some default stubs deleted for simplicity. public function html() { return $this-&gt;builder() -&gt;columns($this-&gt;getColumns()) -&gt;parameters([ 'buttons' =&gt; ['export'], ]); } ... </code></pre> <p>If anyone know please help me.</p> </div>


<div class="post-text" itemprop="text"> <p>I want to populate datatables with database values in a table. Below is my code listing, everything seems to be ok but an error is returned "TypeError: aData is undefined" so datatables is not created</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { $('#listax').dataTable({ "bProcessing": true, "bLengthChange": true, "bFilter": true, "bSort": true, "bInfo": true, "bAutoWidth": true, "bServerSide": true, "sServerMethod": "POST", "sAjaxSource": "&lt;?php echo base_url(); ?&gt;ajax_live/getUsers", "aoColumns": [ null, null //put as many null values as your columns ] }); }); &lt;/script&gt; &lt;table id="listax"&gt;&lt;/table&gt; </code></pre> <p>Server side</p> <pre><code> function getUsers(){ $this-&gt;db-&gt;select('id,username'); $query = $this-&gt;db-&gt;get('user'); $data = $query-&gt;result(); echo json_encode($data); } </code></pre> <p>This is the data returned by json encode</p> <pre><code>[ {"id":"6","username":"Lab23"}, {"id":"11","username":"MaryMM"} ] </code></pre> </div>

Yii Gridview错误类型错误:Jquery(...).popover不是函数[打破此错误] Jquery('[Data-Toggle = Popover]')。popover();

<div class="post-text" itemprop="text"> <p>I'm having an error with gridview update, sorting, paging. The grid is loaded fine via AJAX upon page load. But upon clicking the thead to sort the row, or upon clicking any of the pagination button I get an error saying:</p> <pre><code> Uncaught TypeError: Object [object Object] has no method 'popover' jQuery.yiiGridView.afterAjaxUpdate $.extend.success fire self.fireWith done callback </code></pre> <p>and in Firebug I'm getting:</p> <pre><code>TypeError: jQuery(...).popover is not a function </code></pre> <p>[Break On This Error] </p> <p>jQuery('[data-toggle=popover]').popover();</p> <p>This is pointing to this piece of code:</p> <pre><code> /*&lt;![CDATA[*/ jQuery('#yw0').yiiGridView({'ajaxUpdate':['yw0'],'ajaxVar':'ajax','pagerClass':'pagination','loadingClass':'grid-view-loading','filterClass':'filters','tableClass':'tablehead table table-paper table-condensed table-striped table-sortable table','selectableRows':1,'enableHistory':false,'updateSelector':'{page}, {sort}','filterSelector':'{filter}','pageVar':'RealTime_page','afterAjaxUpdate':function() { jQuery('.popover').remove(); jQuery('[data-toggle=popover]').popover(); jQuery('.tooltip').remove(); jQuery('[data-toggle=tooltip]').tooltip(); }}); /*]]&gt;*/ </code></pre> <p>I tried to solve the problem by including bootstrap.tooltip.js and bootstrap.popover.js additionally but I'm still getting the same error.</p> <p>Here is the part where all the scripts are included:</p> <pre><code>&lt;!-- start: JavaScript--&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery-1.10.2.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery-migrate-1.0.0.min.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/bootstrap.min.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/bootstrap-tooltip.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/bootstrap-popover.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery-ui-1.10.0.custom.min.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.ui.touch-punch.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.cookie.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/fullcalendar.min.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.dataTables.min.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/excanvas.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.flot.min.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.flot.pie.min.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.flot.stack.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.flot.resize.min.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.chosen.min.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.uniform.min.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.cleditor.min.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.noty.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.elfinder.min.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.raty.min.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.iphone.toggle.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.uploadify-3.1.min.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.gritter.min.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.imagesloaded.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.masonry.min.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.knob.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/jquery.sparkline.min.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/js/custom.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;assetManager-&gt;baseUrl; ?&gt;/28e7347b/"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;assetManager-&gt;baseUrl; ?&gt;/28e7347b/jquery.ajaxqueue.js"&gt;&lt;/script&gt; &lt;script src="&lt;?php echo Yii::app()-&gt;assetManager-&gt;baseUrl; ?&gt;/dd5f9a70/gridview/jquery.yiigridview.js"&gt;&lt;/script&gt; &lt;/body&gt; </code></pre> <p></p> <p>Here is the controller that is rendering the view:</p> <pre><code>public function actionUpdateProductData() { Yii::import('application.components.DataScraper.*'); require_once('GetProductData.php'); $productRealTime = RealTime::model()-&gt;findAll(); if (isset($_GET['RealTime'])) { $productRealTime-&gt;attributes = $_GET['RealTime']; } if (count($productRealTime-&gt;model()-&gt;findAll()) === 0) { $symbolData = new GetProductData(); $symbolData-&gt;getAmazonProductData(); } else { echo CJSON::encode( array( 'status' =&gt; 'OK', 'div' =&gt; $this-&gt;renderPartial('_productDataGrid', array( 'model' =&gt; $productRealTime), true, true ), )); } </code></pre> <p>}</p> <p>and here is the view _productDataGrid.php:</p> <pre><code> &lt;?php $this-&gt;widget('bootstrap.widgets.TbGridView', array( 'id' =&gt; 'real-time-grid', 'dataProvider' =&gt; $model-&gt;search(), 'filter' =&gt; $model, 'columns' =&gt; array( 'id', 'name', 'category', 'price' 'rating' ), )); ?&gt; </code></pre> <p>and here is index.php:</p> <pre><code>&lt;div&gt; &lt;hr&gt; &lt;ul class="breadcrumb"&gt; &lt;li&gt; &lt;a href="#"&gt;Home&lt;/a&gt; &lt;span class="divider"&gt;/&lt;/span&gt; &lt;/li&gt; &lt;li&gt; &lt;a href="#"&gt;Stock Info&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;hr&gt; </code></pre> <p></p> baseUrl; $cs = Yii::app()-&gt;getClientScript(); $cs-&gt;registerScriptFile($baseUrl . '/js/ajaxProductDataUpdate.js', CClientScript::POS_END); ?&gt; <p>Last of all Here is the ajaxProductDataUpdate.js</p> <pre><code> var productParameters = { ajaxUpdate: function() { $.ajax({ url: "/ProductAnalysis/index.php/realTime/updateProductData", type: "GET", dataType:"json", error: function(xhr, tStatus, e) { if (!xhr) { alert(" We have an error "); alert(tStatus + " " + e.message); } else { alert("else: " + e.message); // the great unknown } }, success: function(data) { $.fn.yiiGridView.update('real-time-grid', { data: $(this).serialize() }); } }); } }; $(document).ready(function() { productParameters.ajaxUpdate(); }); </code></pre> <p>I just don't know what to do to fix the error. And I need to use gridview badly, in my case... Please provide any help on how to fix the error.</p> <p>Thanks,</p> <p>Maxx </p> </div>


课程主要面向嵌入式Linux初学者、工程师、学生 主要从一下几方面进行讲解: 1.linux学习路线、基本命令、高级命令、vi及vim入门讲解 3.软件安装下载、NFS、Samba、FTP等服务器配置及使用




文章目录经典飞机大战一.游戏设定二.我方飞机三.敌方飞机四.发射子弹五.发放补给包六.主模块 经典飞机大战 源代码以及素材资料(图片,音频)可从下面的github中下载: 飞机大战源代码以及素材资料github项目地址链接 ————————————————————————————————————————————————————————— 不知道大家有没有打过飞机,喜不喜欢打飞机。当我第一次接触这个东西的时候,我的内心是被震撼到的。第一次接触打飞机的时候作者本人是身心愉悦的,因为周边的朋友都在打飞机, 每


92讲视频课+16大项目实战+源码+¥800元课程礼包+讲师社群1V1答疑+社群闭门分享会=99元 &nbsp; 为什么学习数据分析? &nbsp; &nbsp; &nbsp; 人工智能、大数据时代有什么技能是可以运用在各种行业的?数据分析就是。 &nbsp; &nbsp; &nbsp; 从海量数据中获得别人看不见的信息,创业者可以通过数据分析来优化产品,营销人员可以通过数据分析改进营销策略,产品经理可以通过数据分析洞察用户习惯,金融从业者可以通过数据分析规避投资风险,程序员可以通过数据分析进一步挖掘出数据价值,它和编程一样,本质上也是一个工具,通过数据来对现实事物进行分析和识别的能力。不管你从事什么行业,掌握了数据分析能力,往往在其岗位上更有竞争力。 &nbsp;&nbsp; 本课程共包含五大模块: 一、先导篇: 通过分析数据分析师的一天,让学员了解全面了解成为一个数据分析师的所有必修功法,对数据分析师不在迷惑。 &nbsp; 二、基础篇: 围绕Python基础语法介绍、数据预处理、数据可视化以及数据分析与挖掘......这些核心技能模块展开,帮助你快速而全面的掌握和了解成为一个数据分析师的所有必修功法。 &nbsp; 三、数据采集篇: 通过网络爬虫实战解决数据分析的必经之路:数据从何来的问题,讲解常见的爬虫套路并利用三大实战帮助学员扎实数据采集能力,避免没有数据可分析的尴尬。 &nbsp; 四、分析工具篇: 讲解数据分析避不开的科学计算库Numpy、数据分析工具Pandas及常见可视化工具Matplotlib。 &nbsp; 五、算法篇: 算法是数据分析的精华,课程精选10大算法,包括分类、聚类、预测3大类型,每个算法都从原理和案例两个角度学习,让你不仅能用起来,了解原理,还能知道为什么这么做。


在系统内核开发中,经常会用到串口调试,利用VMware的Virtual Machine更是为调试系统内核如虎添翼。那么怎么搭建串口调试环境呢?因为最近工作涉及到这方面,利用强大的google搜索和自己


获取讲师答疑方式: 在付费视频第一节(触摸命令_ALL)片头有二维码及加群流程介绍 限时福利 原价99元,今日仅需39元!购课添加小助手(微信号:csdn590)按提示还可领取价值800元的编程大礼包! 讲师介绍: 苏奕嘉&nbsp;前阿里UC项目工程师 脚本开发平台官方认证满级(六级)开发者。 我将如何教会你通过【定制脚本】赚到你人生的第一桶金? 零基础程序定制脚本开发课程,是完全针对零脚本开发经验的小白而设计,课程内容共分为3大阶段: ①前期将带你掌握Q开发语言和界面交互开发能力; ②中期通过实战来制作有具体需求的定制脚本; ③后期将解锁脚本的更高阶玩法,打通任督二脉; ④应用定制脚本合法赚取额外收入的完整经验分享,带你通过程序定制脚本开发这项副业,赚取到你的第一桶金!




C++语言基础视频培训课程:本课与主讲者在大学开出的程序设计课程直接对接,准确把握知识点,注重教学视频与实践体系的结合,帮助初学者有效学习。本教程详细介绍C++语言中的封装、数据隐藏、继承、多态的实现等入门知识;主要包括类的声明、对象定义、构造函数和析构函数、运算符重载、继承和派生、多态性实现等。 课程需要有C语言程序设计的基础(可以利用本人开出的《C语言与程序设计》系列课学习)。学习者能够通过实践的方式,学会利用C++语言解决问题,具备进一步学习利用C++开发应用程序的基础。




深度学习系列课程从深度学习基础知识点开始讲解一步步进入神经网络的世界再到卷积和递归神经网络,详解各大经典网络架构。实战部分选择当下最火爆深度学习框架PyTorch与Tensorflow/Keras,全程实战演示框架核心使用与建模方法。项目实战部分选择计算机视觉与自然语言处理领域经典项目,从零开始详解算法原理,debug模式逐行代码解读。适合准备就业和转行的同学们加入学习! 建议按照下列课程顺序来进行学习 (1)掌握深度学习必备经典网络架构 (2)深度框架实战方法 (3)计算机视觉与自然语言处理项目实战。(按照课程排列顺序即可)


本课程适合CCNA或HCNA网络小白同志,高手请绕道,可以直接学习进价课程。通过本预科课程的学习,为学习网络工程师、思科CCNA、华为HCNA这些认证打下坚实的基础! 重要!思科认证2020年2月24日起,已启用新版认证和考试,包括题库都会更新,由于疫情原因,请关注官网和本地考点信息。题库网络上很容易下载到。




本课程内容系统、全面、简洁、通俗易懂,通过2个多小时的介绍,让大家对软件测试有个系统的理解和认识,具备基本的软件测试理论基础。 主要内容分为5个部分: 1 软件测试概述,了解测试是什么、测试的对象、原则、流程、方法、模型;&nbsp; 2.常用的黑盒测试用例设计方法及示例演示;&nbsp; 3 常用白盒测试用例设计方法及示例演示;&nbsp; 4.自动化测试优缺点、使用范围及示例‘;&nbsp; 5.测试经验谈。


未经我的允许,请不要转载我的文章,在此郑重声明!!! 请先配置安装好Java的环境,若没有安装,请参照我博客上的步骤进行安装! 安装Java环境教程 Tomcat部署Web项目(一)·内嵌

2019数学建模A题高压油管的压力控制 省一论文即代码


图书管理系统(Java + Mysql)我的第一个完全自己做的实训项目

图书管理系统 Java + MySQL 完整实训代码,MVC三层架构组织,包含所有用到的图片资源以及数据库文件,大三上学期实训,注释很详细,按照阿里巴巴Java编程规范编写




微信小程序番茄时钟视频教程,本课程将带着各位学员开发一个小程序初级实战类项目,针对只看过官方文档而又无从下手的开发者来说,可以作为一个较好的练手项目,对于有小程序开发经验的开发者而言,可以更好加深对小程序各类组件和API 的理解,为更深层次高难度的项目做铺垫。

[已解决]踩过的坑之mysql连接报“Communications link failure”错误

目录 前言 第一种方法: 第二种方法 第三种方法(适用于项目和数据库在同一台服务器) 第四种方法 第五种方法(项目和数据库不在同一台服务器) 总结 前言 先给大家简述一下我的坑吧,(我用的是mysql,至于oracle有没有这样的问题,有心的小伙伴们可以测试一下哈), 在自己做个javaweb测试项目的时候,因为买的是云服务器,所以数据库连接的是用ip地址,用IDE开发好...


系列课程主要分为3大阶段:(1)首先掌握计算机视觉必备算法原理,结合Opencv进行学习与练手,通过实际视项目进行案例应用展示。(2)进军当下最火的深度学习进行视觉任务实战,掌握深度学习中必备算法原理与网络模型架构。(3)结合经典深度学习框架与实战项目进行实战,基于真实数据集展开业务分析与建模实战。整体风格通俗易懂,项目驱动学习与就业面试。 建议同学们按照下列顺序来进行学习:1.Python入门视频课程 2.Opencv计算机视觉实战(Python版) 3.深度学习框架-PyTorch实战/人工智能框架实战精讲:Keras项目 4.Python-深度学习-物体检测实战 5.后续实战课程按照自己喜好选择就可以

2019 AI开发者大会

2019 AI开发者大会(AI ProCon 2019)是由中国IT社区CSDN主办的AI技术与产业年度盛会。多年经验淬炼,如今蓄势待发:2019年9月6-7日,大会将有近百位中美顶尖AI专家、知名企业代表以及千余名AI开发者齐聚北京,进行技术解读和产业论证。我们不空谈口号,只谈技术,诚挚邀请AI业内人士一起共铸人工智能新篇章!






《YOLOv3目标检测实战系列课程》旨在帮助大家掌握YOLOv3目标检测的训练、原理、源码与网络模型改进方法。 本课程的YOLOv3使用原作darknet(c语言编写),在Ubuntu系统上做项目演示。 本系列课程包括三门课: (1)《YOLOv3目标检测实战:训练自己的数据集》 包括:安装darknet、给自己的数据集打标签、整理自己的数据集、修改配置文件、训练自己的数据集、测试训练出的网络模型、性能统计(mAP计算和画出PR曲线)和先验框聚类。 (2)《YOLOv3目标检测:原理与源码解析》讲解YOLOv1、YOLOv2、YOLOv3的原理、程序流程并解析各层的源码。 (3)《YOLOv3目标检测:网络模型改进方法》讲解YOLOv3的改进方法,包括改进1:不显示指定类别目标的方法 (增加功能) ;改进2:合并BN层到卷积层 (加快推理速度) ; 改进3:使用GIoU指标和损失函数 (提高检测精度) ;改进4:tiny YOLOv3 (简化网络模型)并介绍 AlexeyAB/darknet项目。






DirectX修复工具(DirectX Repair)是一款系统级工具软件,简便易用。本程序为绿色版,无需安装,可直接运行。 本程序的主要功能是检测当前系统的DirectX状态,如果发现异常则进行修复



Vue.js 2.0之全家桶系列视频课程

基于新的Vue.js 2.3版本, 目前新全的Vue.js教学视频,让你少走弯路,直达技术前沿! 1. 包含Vue.js全家桶(vue.js、vue-router、axios、vuex、vue-cli、webpack、ElementUI等) 2. 采用笔记+代码案例的形式讲解,通俗易懂


十个c语言案例 (1)贪吃蛇 (2)五子棋游戏 (3)电话薄管理系统 (4)计算器 (5)万年历 (6)电子表 (7)客户端和服务器通信 (8)潜艇大战游戏 (9)鼠标器程序 (10)手机通讯录系统

相关热词 c# 不能序列化继承类 c# char* 调用 c# 开发dll模板 c#添加控件到工具箱 c#控制台组合数 编程计算猴子吃桃问题c# c# wpf 背景透明 随机抽取号码软件c# c# 开发环境 c# 属性和字段