Eel icon indicating copy to clipboard operation
Eel copied to clipboard

Redirecting to a different page in different folder

Open Majed04 opened this issue 6 years ago • 2 comments

Describe the problem hey i have two folders inside file call " Pages " first folder call WelcomePage which have html file and css and the different page call MainPage which have the same html file and css so i was trying to redirecting from WelcomePage folder into MainPage it says " Error: 404 Not Found Sorry, the requested URL 'http://localhost:8000/Pages/MainPage/index.html' caused an error: File does not exist. " i tried on live server extension it worked prefectily is this kinda bug or what? thank you!

import eel
import eel
eel.init('Pages/WelcomePage')


eel.start('index.html')


...
<html>
   <button onclick="window.location.href = '../MainPage/index.html'>SecondPage</button>
</html>

second html

<html>
<p> hello world </p>
</html>

Majed04 avatar Nov 11 '20 10:11 Majed04

You've told Eel that the root path for your HTML files is Pages/WelcomePage, so I don't think it likes you navigating up beyond that directory.

If you change it to the following it should be OK:

eel.init('Pages')

eel.start('WelcomePage/index.html')

samuelhwilliams avatar Nov 11 '20 10:11 samuelhwilliams

Yeah it worked thank you! @samuelhwilliams

Majed04 avatar Nov 11 '20 19:11 Majed04