All Jquery removed replaced with stand JS and non jqery dependent libs

This commit is contained in:
johnnyq
2026-08-14 17:28:06 -04:00
parent 2354dd1511
commit bbbfff7413
35 changed files with 753 additions and 328 deletions

View File

@@ -19,18 +19,30 @@ ob_start();
</div>
<script>
$(function() {
$.ajax({
url: 'ajax.php?ai_ticket_summary',
document.addEventListener('DOMContentLoaded', function () {
var target = document.getElementById('summaryContent');
if (!target) {
return;
}
fetch('ajax.php?ai_ticket_summary', {
method: 'POST',
data: { ticket_id: <?= $ticket_id ?> },
success: function(response) {
$('#summaryContent').html(response);
},
error: function() {
$('#summaryContent').html('Error generating summary.');
}
});
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
credentials: 'same-origin',
body: new URLSearchParams({ ticket_id: '<?= $ticket_id ?>' }).toString()
})
.then(function (res) {
if (!res.ok) {
throw new Error('HTTP ' + res.status);
}
return res.text();
})
.then(function (html) {
target.innerHTML = html;
})
.catch(function () {
target.textContent = 'Error generating summary.';
});
});
</script>