java - 前端页面请求后端不返回页面
怪我咯
怪我咯 2017-04-18 10:37:18
0
7
842
怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(7)
刘奇

This is an ajax request. The ajax request page will not jump.
Why don’t you just use a normal request if you log out?

黄舟

You just sent an ajax request on the front end instead of a page jump.

Either let the backend return json data, and the frontend uses js to jump to the landing page according to its content;
or the frontend jumps directly to the target address, and let the backend redirect to the landing page.

黄舟

Control page jump after ajax returns results:

location.href = 'xxxxx'
黄舟

The return data of the ajax request will be processed in the return function function(data, status). You can jump to the page in this function
You can also write like this

$('#exit').click(function(){
   window.location.href = location.host + "../Exit"; 
});
Ty80

Using ajax to call itself is wrong, so the front-end page will not jump. If you don’t believe me, type out the data and status in the ajax callback function to see what the result is

Jumping can be done on both the front and back ends. If you use ajax, it means you want to receive things from the back end and not let it control the page jump. If you want to control the back end, just use location.href

Ty80

Ajax requests will not jump in the background code because asynchronous work has been performed. After executing your background code, the content in your
Exit(){...} method will be returned to your front-end Ajax The function(data,status) method exists in data.
If you want to jump: use it in the method body

if(data=="Login"){
    window.location.href="url";
}
巴扎黑

Did you not configure the view resolver

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template