ESP32-OTA-Example icon indicating copy to clipboard operation
ESP32-OTA-Example copied to clipboard

HTML - Open URL in same window and in same tab

Open OslafEman opened this issue 6 years ago • 3 comments

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 avatar Feb 22 '19 01:02 OslafEman

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

OslafEman avatar Feb 22 '19 20:02 OslafEman

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

G6EJD avatar Feb 22 '19 20:02 G6EJD

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

G6EJD avatar Feb 22 '19 20:02 G6EJD