I have a page that has a form
In this way, it contains some inputs, which have classes, eg:
<input type="text" class="datepicker">
<input type="text" class="marcara-cpf">
And the configuration of some of the plugins is done in a js file
$(".datepicker").config...
$(".mascara-cpf").mask("000.000.000-00")
It turns out that when the page is loaded by ajax, it does not set the configuration of those plugins
, having to call this configuration again. What makes the code repetitive, any place that has a cpf masraca, have to do this ... where I could only pass the% cos_de% mascara-cpf to the desired input.
I have read in some places that the implementation of class
could solve (using require.js)
But I do not know how laborious it will be to implement this require.js in every app
Is there another elegant way to solve this problem with pages loading in ajax?