created sample code for ajax
This commit is contained in:
parent
29bebb6d5c
commit
c9ac4d6545
1
res/forum/admin.html
Normal file
1
res/forum/admin.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<img src="http://109.123.243.163:1025/6.jpg">
|
20
res/forum/script.js
Normal file
20
res/forum/script.js
Normal 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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user