ESP32-OTA-Example
ESP32-OTA-Example copied to clipboard
HTML - Open URL in same window and in same tab
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.
The spaces after the "/" and before "serverIndex" are typing errors and do not appear in the code. Sorry for that.
The problem you have is an html one, check out W3C for the correct html to open a window within a window.
You will probably find iframes are no longer supported by most new browsers