location.href not working

前端 未结 1 485
没有蜡笔的小新
没有蜡笔的小新 2021-01-29 00:52

I have used location.href in my earlier days but now its not redirecting to page. here is my code

function AuthenticateUserWithPage() {
var UId = $(\'#amwayId\')         


        
1条回答
  •  别那么骄傲
    2021-01-29 01:46

    Php:

     $form_data = array();
     $form_data['message'] = "success";
     $form_data['redirect'] = "http://www.example.com/example";
     echo json_encode($form_data)
    

    Ajax:

    if (data.message == 'success') {
    window.location.href = data.redirect;
    return false;
    }else if(){
    etc...
    }
    

    0 讨论(0)
提交回复
热议问题