function ajaxPerl() { $.ajax({ method: 'GET', url: `../cgi-bin/test-dbi.pl`, dataType: 'json', header: { "content-type": "application/json;charset=utf-8" } }).then((response) => { console.log('RESPONSE -> ', response); }).catch((error) => { console.log('ERROR -> ', error); }); }