+ 7
Can i embed a html file from a GitHub repo directly in my html code using iframe or anything?
I want to add a html file from a repo but the link doesn't return the file but the file opens from GitHub itself. How can i solve this prob?
8 Antworten
+ 1
🇧🇩Saadman Nuheen🇧🇩 really sorry. I didn't see that you wanted to embed *html code in an iframe* from github (don't know what's happening today). I thought you wanted to import a css or js file from github. I don't think you can show the code in an iframe because the html content is rendered in the browser and so there is no way you can get rendered html from github. Instead what you can do is get the code through javascript and then put it in the html to be rendered to the screen. See this
https://code.sololearn.com/WAsU6tW6zNCn/?ref=app
Try adding something in your html file at the url or change the url to see it
+ 3
Ok let me try....
+ 3
XXX
See this:
https://code.sololearn.com/WnzoE9Y9xP7f/?ref=app
why is it giving an error?
+ 3
Mahdee Mohammad
I know but uploading the files to dropbox is the last solution i needed.
I need to know how can i do it from github.
https://code.sololearn.com/WnzoE9Y9xP7f/?ref=app
This method is showing an error too.
+ 2
First make sure that the repo is public so that the files can be accessed from your code. Then you go to the file on the GitHub website. There you will see an option: "View Raw". Click on that. You will be redirected to another page where you'll see the raw code. Just copy the link of that page and paste it in your code.
+ 2
well, you can do it by uploading it to dropbox. I never tried yet, but you give it a try, hope it'll work.
+ 1
hope this will help you..
https://code.sololearn.com/WW6t4B73kJVz/?ref=app
- 2
Hi