My login form opens in a modal window (Lightview, which is a jQuery modal). The author has abandoned support, but the modal works great for multiple needs.
I keep a variable, which holds the full path to the current page. On successful login, which is authenticated with an AJAX script, I simply do a relocate to the current page as "parent". That page needs to refresh in order to note the user is logged in and provide a logout button. But it also needs to pull up another model with menu selections for the logged in user. In order to open that menu, I sent a variable to the url, which is picked up in the footer. This all works fine in other browsers, but not in IE11.
So, the process is
1. User presses login button. This brings up the login form in Lightview. (Full path of CurrentPage is held in variable
2. Form is submitted to an AJAX authentication.
3. On success, location is directed back to the current page using
In browsers other than IE11, this closes the model window, refreshes the current page, the Exp is picked up by a javascript function, and the logged-in menu appears in another modal.
I have tried every way imaginable, including replace, assign, window.top ... nothing seems to work in IE11. It simply does nothing, The page does not relocate and the url does not go to the address bar. Even tried history.go(-1). Any known solutions to this problem?
Apparently, IE11 does not like includes() . So, even just using window.parent.location works as expected outside the if/else.
That said, in trying to solve the problem, I found a lot of people having problems with IE11 and redirects, so I jumped to that as the problem without thinking further. None of other's solutions worked for me because the redirect was not the problem. Your solution may be helpful to someone else struggling with the IE problem, however.
Finally, thank you for the more eloquent way of dealing with the query string. That eliminates the if/else and, indeed, solves the problem.
RationalRabbit
ASKER
Confirmed after checking. Internet Explorer does not support the includes() method.
Open in new window