Uncaught TypeError: Cannot read property 'prototype' of undefined
Uncaught TypeError: Cannot read property 'prototype' of undefined
Don't know why, this error its being shown today:
Uncaught TypeError: Cannot read property 'prototype' of undefined
at dataTables.editor.min.js:1013
at dataTables.editor.min.js:50
at dataTables.editor.min.js:52
(anonymous) @ dataTables.editor.min.js:1013
(anonymous) @ dataTables.editor.min.js:50
(anonymous) @ dataTables.editor.min.js:52
There is no apparently problem, no errors except this are returned, everything working fine, however seeing this error in the console is killing me.
if('ontouchstart' in document.documentElement) document.write("<script src='assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
$(document).ready(function() {
var table = $('#publicationTable').DataTable( {
lengthChange: true,
ajax: {
url: "lib/publicationProcessing.php",
type: "POST"
},
serverSide: true,
columns: [
{ data: "p.status",
render: function ( data, type, row ) {
var text = "";
if (type == "display") {
if (data == "1") {
text = "<i class='ace-icon fa fa-circle green'></i>";
} else {
text = "<i class='ace-icon fa fa-circle red'></i>";
}
data = text
}
return data;
}
},
{ data: "ti.tituloPublicacao" },
{ data: "ty.tipoPublicacao" },
{ data: "p.ano" },
{ data: "p.competencia" },
{ data: "c.razaoSocial" },
{ data: "e.nome" },
{ data: null,
render: function(data, type, full){
return '<a data-toggle="modal" data-target="#infoModal" data-id="' + full.p.id_Publication + '" id="getPublication" class="blue"><i class="ace-icon fa fa-search-plus bigger-130"></i></a> <a class="red" href="deletePublication.php?id_Publication=' + full.p.id_Publication + '"><i class="ace-icon fa fa-trash-o bigger-130"></i></a> <a class="orange" href="' + full.p.caminho + full.p.arquivo +'" target="_blank"><i class="ace-icon fa fa-download bigger-130"></i></a>';
}
}
],
"columnDefs": [
{ "orderable": false, "targets": 0 },
{ "orderable": false, "targets": 7 },
],
"sScrollX": "100%",
"sScrollXInner": "105%",
} );
$(document).on('click', '#getPublication', function(e){
e.preventDefault();
var uid = $(this).data('id'); // it will get id of clicked row
$('#dynamic-content').html(''); // leave it blank before ajax call
$('#modal-loader').show(); // load ajax loader
$.ajax({
url: 'getPublication.php',
type: 'POST',
data: 'id='+ uid,
dataType: 'html'
})
.done(function(data){
console.log(data);
$('#dynamic-content').html('');
$('#dynamic-content').html(data); // load response
$('#modal-loader').hide(); // hide ajax loader
})
.fail(function(){
$('#dynamic-content').html('<i class="fa fa-exclamation-triangle red"></i> Algo deu errado, por favor tente novamente...');
$('#modal-loader').hide();
});
});
$("#btnPublication").click(function(){
$("#publicationModal").modal({backdrop: 'static', keyboard: false});
});
} );
$(function(){
$('#publicationModal').on('shown.bs.modal', function () {
$('.chosen-select', this).chosen();
$(".input-mask-date").mask("99/99/9999");
$('#file-input').ace_file_input({
no_file: 'Selecione um arquivo',
droppable: 'true',
btn_choose: 'Escolha',
btn_change : 'Escolha',
thumbnail: 'large',
allowExt: ['pdf', 'xml', 'pfx', 'nfe', 'docx', 'doc', 'zip', 'rar', 'txt', 'cer', 'pfx', 'jpeg','jpg','png'],
allowMime: ['application/pdf', 'application/msword','image/pjpeg', 'image/jpeg', 'application/x-compressed','image/png', 'multipart/x-zip', 'application/zip', 'application/x-zip-compressed', 'text/plain', 'application/pkix-cert', 'application/x-pkcs12', 'application/x-x509-user-cert ', 'application/x-x509-ca-cert', 'application/xml', 'text/xml']
})
.on('file.error.ace', function(event, info) {
$.gritter.add({
title: '<i class="fa fa-exclamation-circle" aria-hidden="true"></i> Arquivo Inválido!',
text: 'O arquivo selecionado é de formato inválido. Selecione arquivos que possuam um dos seguintes formatos:<ul><li>Documentos PDF</li><li>Documentos XML</li><li>Documentos Word</li><li>Notas Fiscais e Notas Fiscais Eletrônicas</li><li>Arquivos Compactados</li><li>Arquivos de Texto</li><li>Certificados Digitais</li><li>Imagens</li></ul>',
class_name: 'gritter-error'
});
return false;
event.preventDefault();
});
});
});
window.Parsley.on('parsley:form:validated', function(e){
if (e.validationResult) {
$('button[type=submit]').attr('disabled', 'disabled');
}
});
This question has an accepted answers - jump to answer
Answers
That's odd! Can you give me a link to the page so I can check it out please?
Thanks,
Allan
What page you want @allan? Is my webiste page?
And how much odd is this?
A page on which the error can be reproduced.
There is no way @tangerine. This error is apearing in the localhost server. It's not online yet.
I'm afraid there is very little help we can offer in that case since we can't debug it. I don't immediately see any issue with the above code, and it might be an interaction with loading some other library, but its impossible to say without a test case which is why I asked for one.
Regards,
Allan