jQuery-Mask-Plugin icon indicating copy to clipboard operation
jQuery-Mask-Plugin copied to clipboard

Bug when use setInterval.

Open drafenous opened this issue 5 years ago • 0 comments

Hello I'm using the latest version of the plugin, but when I'm going to use setting up in a 1000ms setinterval, the mask bug, and I can not display the formatting in cash...

My code: ` setInterval(() => { realTimeHeaders(); )}, 10000);

function realTimeHeaders(){
	$.ajax({
		url: '<?= base_url("assets/src/json/dashboard-headers.json"); ?>',
		cache: false,
		dataType: 'json',
		success: (response) => {
			$('#faturamentoGeral0').html(response['faturamentoGeral'][0]);
			$('#faturamentoGeral1').html(response['faturamentoGeral'][1]);

			$('#faturamentoSP0').html(response['faturamentoSP'][0]);
			$('#faturamentoSP1').html(response['faturamentoSP'][1]);

			$('#faturamentoFSP0').html(response['faturamentoFSP'][0]);
			$('#faturamentoFSP1').html(response['faturamentoFSP'][1]);

			$('#headers .money').mask(window['globalSettings'].defaultMoneyMask, {reverse: true}).trigger('keyup');
			return response;
		},
		error: (response) => {
			return console.error(response);
		}
	})
}`

Thanks alot!

drafenous avatar Apr 09 '19 19:04 drafenous