HTML
mroumani

I am asking my students to create a multipage website. However, when they add a file and name it page2.html and run it, the code doesn't appear. Only the index.html code appears.
If we try including an internal link to the second page, it will run correctly.
How do we get it so that if we have the code for page 2 is displayed and we click run, we can see it work?

You are viewing a single comment. View All
AllAwesome497

Ok make either a link to it on the main page or redirect it. It will always start on main page, but if u open it in a new tab and go to the second page u can just refresh to see it updated (once u run it).

mroumani

@AllAwesome497
Thank you! I created a link and when it opens, I can change page2, and if I refresh the tab, anything I change shows up.
So, is there no way to see the second page run inside of repl.it?

abc3354

@mroumani Hi
I do not think you have a way to do that appart using the "meta refresh" redirection.
You can submit this idea to replit feedback or upvote it if you find it.

EDIT: I tried it here
EDIT2: @AllAwesome497 method is better.

AllAwesome497

@mroumani Yes. Using a little bit of js... window.location.href="<pageName>" it will redirect to the other page upon opening it, Although u won't be able to open that page with the script on it bc soon as u open it it will go to the other (until u remove it, of course). This will also slow down the time for it to run a little bit though.

ChristianThone

@mroumani There is if you look beside the Page URL in the Output there will be what looks like a sqaure with an arrow pointing out of it, it is right next to the pencil:

https://storage.googleapis.com/replit/images/1551296497098_eac35d47c88ba9f9c207ab362496cc47.pn

Click that and it will pop the webpage into a new tab.

Cerberus_75

yeah you can do what @christianthone suggested and then in the URL bar you can add /page2 which is your file address for replit