Updating js plugins

This commit is contained in:
ahwelp
2023-01-24 20:31:23 +00:00
parent b1eb0a7a56
commit 2b6ddf9569
602 changed files with 109412 additions and 18 deletions
+24
View File
@@ -0,0 +1,24 @@
(function ($) {
$.fn.remoteFill = function (target = false) {
var location = $(this);
let cep = $(this).parent().find('input').val();
cep = String(cep).replace(/[^\d]/g, '');
fetch('/postal/search/' + cep, {
method: 'GET',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Requested-With': 'fetch'
}
}).then(function (response) {
let json = response.json();
return json;
}).then(function(json){
target(json)
});
};
})(jQuery);