Widget:LoadRemoteContent: Difference between revisions

From Rangjung Yeshe Wiki - Dharma Dictionary
Jump to navigation Jump to search
((by SublimeText.Mediawiker))
((by SublimeText.Mediawiker))
Line 1: Line 1:
<div id="<!--{$id}-->">
<div id="<!--{$id}-->"></div>
<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 () {
function load(url, element)
$("#<!--{$id}-->").load("<!--{$src}--> #<!--{$hash}-->");
{
});
    fetch(url).then(res => {
        element.innerHTML = res;
    });
}
 
load("<!--{$src}-->", document.getElementById("<!--{$hash}-->"));
 
</script>
</script>
</div>

Revision as of 09:46, 19 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"> $(document).ready(function () { $("#").load(" #"); }); </script>