Last active
January 23, 2019 22:58
-
-
Save CarlosDanielDev/864f827d7807e84383fba0158c9c11da to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Uncaught TypeError: Illegal invocation | |
at add (jquery.js:8260) | |
at buildParams (jquery.js:8247) | |
at buildParams (jquery.js:8241) | |
at buildParams (jquery.js:8241) | |
at buildParams (jquery.js:8241) | |
at buildParams (jquery.js:8241) | |
at Function.jQuery.param (jquery.js:8280) | |
at Function.ajax (jquery.js:8866) | |
at HTMLButtonElement.<anonymous> (funcoes.js:6855) | |
at HTMLDocument.dispatch (jquery.js:5110) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
$(document).on('click', '#add_certi', function(){ | |
let array; | |
let idLote = $('#id_lote').val(); | |
let idUnidade = $('#id_unidade').val(); | |
let idGrupo = $('#id_grupo').val(); | |
$("#loader").show().fadeTo('fast', 1); | |
$('#add_certificado').fadeTo( "slow" , 0.15); | |
array = $('input:checked').map(function(){ | |
return this.value; | |
}); | |
$.ajax({ | |
type:"POST", | |
url: '/vincula-certificado', | |
data:{array, idLote, idUnidade, idGrupo}, | |
success: function(result){ | |
$("#loader").hide(); | |
$('#add_certificado').fadeTo("slow", 1); | |
} | |
}); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Serialize an array of form elements or a set of | |
// key/values into a query string | |
jQuery.param = function( a, traditional ) { | |
var prefix, | |
s = [], | |
add = function( key, valueOrFunction ) { | |
// If value is a function, invoke it and use its return value | |
var value = jQuery.isFunction( valueOrFunction ) ? | |
valueOrFunction() ://AQUI ELE ME RETORNA O ERRO DE ILLEGAL INVOCATION | |
valueOrFunction; | |
s[ s.length ] = encodeURIComponent( key ) + "=" + | |
encodeURIComponent( value == null ? "" : value ); | |
}; | |
// If an array was passed in, assume that it is an array of form elements. | |
if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { | |
// Serialize the form elements | |
jQuery.each( a, function() { | |
add( this.name, this.value ); | |
} ); | |
} else { | |
// If traditional, encode the "old" way (the way 1.3.2 or older | |
// did it), otherwise encode params recursively. | |
for ( prefix in a ) { | |
buildParams( prefix, a[ prefix ], traditional, add ); | |
} | |
} | |
// Return the resulting serialization | |
return s.join( "&" ); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment