I want to code something to fetch and run the code using a predetermined link, which will likely by a GitHub raw code link. Would it be possible to code this in html?
To be entirely honest, I mainly code in scratch using turbowarp. I’m trying to broaden my horizons but I don’t know much about coding and this is the start.
2
Answers
You can not code this in html because you don’t code in html, you design html (it’s a tagong language not a coding lqnguage).
Anyway, to do this, if yoy want to get a full page in to your page you can use iframe. But if you need to get some custom html without refreshing the page ajax (using in javascript) would be best option
Here’s an example of how you could do it:
Replace
'YOUR_RAW_GITHUB_CODE_LINK_HERE'
with the actual link to your GitHub raw code. However, keep in mind that usingeval()
to run arbitrary code fetched from the internet can be risky in terms of security. Make sure you trust the source of the code you’re fetching.Also, note that this example is very basic and not suitable for all types of code.