DWQA QuestionsCategory: Programwindow.location.href No jump
lovekun asked 2 months ago

After the XMLHttpRequest submits the form, it will jump the page according to the returned results, but window.location.href Invalid jump
图片描述
图片描述

charles replied 2 months ago

Can the login OK window pop up?

charles replied 2 months ago

Can pop up, just can’t jump to the registration page

3 Answers
lovekun answered 2 months ago

The problem has been solved because the ajaxcheck() function is triggered when the form is submitted. After the function is executed, it does not return false to prevent the form from submitting. As a result, the page will refresh, and it cannot jump correctly.
If the onsubmit function does not return, the default return value is false.
There is no problem with the following method.
图片描述
图片描述

whhlu answered 2 months ago

Print out window.location.href Jump to the address, and then copy to the browser to see if you can enter, determine whether the URL problem

Oooooooo answered 2 months ago

We have encountered the problem that the URL is correct, but cannot jump. With the help of setTimeout, the specific cause has not been found out

Teng long asks the sky replied 2 months ago

It has not been solved. It has been tried. It is invalid in Windows server2016