I'm having this problem
Uncaught TypeError: Can not read property 'locac' of undefined
With the code:
function fnc(){
var evt = (window.event ? window.event : event);
var elemento = evt.target;
var params = $(elemento).data('params');
alert(params.locac);
}
$('body').on('click','button.inst',fnc);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><buttontype="button" data-params='{"locac":"reg","titulo":"Inserir Registro"}' class="btn btn-success inst">Inserir</button>
Sample link: example
But not always the error occurs, there is time that I click the button several times and it does not give this error, but there are times that I click once and it already gives error.
Sometimes it gives error and does not give error.
The error I only see in the real world