Widget:LoadRemoteContent: Difference between revisions

From Rangjung Yeshe Wiki - Dharma Dictionary
Jump to navigation Jump to search
No edit summary
((by SublimeText.Mediawiker))
Line 1: Line 1:
<div id="<!--{$id}-->"></div>
<div id="<!--{$id}-->">
<script
<script
   src="https://code.jquery.com/jquery-3.6.0.slim.min.js"
   src="https://code.jquery.com/jquery-3.6.0.slim.min.js"
Line 5: Line 5:
   crossorigin="anonymous"></script>
   crossorigin="anonymous"></script>
<script type="text/javascript" crossorigin="anonymous">
<script type="text/javascript" crossorigin="anonymous">
$(document).ready(function () {
 
$("#<!--{$id}-->").load("<!--{$src}--> #<!--{$hash}-->");
function load(url, element)
});
{
    fetch(url).then(res => {
        element.innerHTML = res;
    });
}
 
load("<!--{$src}-->", document.getElementById("<!--{$hash}-->"));
 
</script>
</script>
</div>

Revision as of 16:24, 17 May 2021

<script

 src="https://code.jquery.com/jquery-3.6.0.slim.min.js"
 integrity="sha256-u7e5khyithlIdTpu22PHhENmPcRdFiHRjhAuHcs05RI="
 crossorigin="anonymous"></script>

<script type="text/javascript" crossorigin="anonymous">

function load(url, element) { fetch(url).then(res => { element.innerHTML = res; }); }

load("", document.getElementById(""));

</script>