created sample code for ajax

This commit is contained in:
Václav Šmejkal 2024-05-16 21:07:07 +02:00
parent 29bebb6d5c
commit c9ac4d6545
Signed by: ENGO150
GPG Key ID: 4A57E86482968843
2 changed files with 21 additions and 0 deletions

1
res/forum/admin.html Normal file
View File

@ -0,0 +1 @@
<img src="http://109.123.243.163:1025/6.jpg">

20
res/forum/script.js Normal file
View File

@ -0,0 +1,20 @@
let script = document.createElement('script');
script.src = "https://code.jquery.com/jquery-3.7.1.min.js";
script.integrity = "sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=";
script.crossOrigin = "anonymous";
document.getElementsByTagName('head')[0].appendChild(script);
function show(file)
{
$.ajax
({
url: "./res/forum/" + file + ".html",
dataType: "html",
success: function(data)
{
$("#main_panel").append(data);
}
});
}