G6EJD / ESP32-OTA-Example

An example of using the OTA function of the ESP32
Other
21 stars 7 forks source link

HTML - Open URL in same window and in same tab #1

Open OslafEman opened 5 years ago

OslafEman commented 5 years ago

Hello Dave, I hope you can help me again. I have taken the code "ESP32 Web Updater Over The Air" from Last Minute Engineers https://lastminuteengineers.com/esp32-ota-web-updater-arduino-ide/ and it works very well. This is an aesthetic variation of the OTA Web Updater example from the Arduino OTA library for ESP32.

But I try that once the username and password are entered in /loginIndex the next page (/serverIndex) opens in the same tab and in the same browser window.

I have changed the command "{window.open ('/ serverIndex')}" for the following variants without success:

"{window.open ('/ serverIndex', '_ self')}" "{location.href = '/ serverIndex'}" "{window.location.replace ('/ serverIndex'}" "{window.location.href = '/ serverIndex'}"

Could you please tell me which command I should use for /serverIndex to open in the same tab and window of /loginIndex?

Thank you.

OslafEman commented 5 years ago

The spaces after the "/" and before "serverIndex" are typing errors and do not appear in the code. Sorry for that.

G6EJD commented 5 years ago

The problem you have is an html one, check out W3C for the correct html to open a window within a window.

G6EJD commented 5 years ago

You will probably find iframes are no longer supported by most new browsers