Culture: Difference between revisions
From Anarchy In Action
D A Earwig (talk | contribs) m (Probably last test) |
D A Earwig (talk | contribs) (D A Earwig changed the content model of the page Culture from "JavaScript" to "wikitext": javascript content model does not allow use of javascript; switching back) Tag: content model change |
(No difference)
|
Revision as of 14:43, 18 March 2024
<iframe id="github-iframe" src=""></iframe> <script>
// Fetch the raw content of the file from GitHub fetch('https://raw.githubusercontent.com/AnarchyInAction/TheGoldenPath/main/Data/FoodAgricultureWater') .then(function(response) { // Check if the response is successful if (response.ok) { // Return the response text return response.text(); } // Throw an error if the response is not successful throw new Error('Network response was not ok.'); }).then(function(data) { // Get the iframe element var iframe = document.getElementById('github-iframe'); // Set the srcdoc attribute with the fetched content iframe.srcdoc = data; }).catch(function(error) { // Log any errors to the console console.error('There was a problem with the fetch operation:', error); });
</script>