jqueryMobile with backbonejs를 사용하고 있습니다. 작업 : 전자 메일 및 암호 필드가있는 로그인 양식. 양식을 작성하여 3 개 링크와 같은 형태로 리디렉션 :응답을 가져 오기 전에 window.reload가 다시로드됩니다.
- 업데이트 프로필
- 변경 PWD
- 로그 아웃
문제 : 로그 아웃은 내가 로그인에 다시 리디렉션 할을 클릭하면 "성공적으로 로그 아웃되었습니다."라는 메시지가있는 양식 (동일한 페이지) 내가 무슨 짓을했는지
: view.js에서 : (CakePHP에서의) MYCONTROLLER에서
$('#logoutClick').click(function() {
console.log("hi");
this.collection = new Fan();
this.collection.logoutFan();
window.location.reload(true);
});
: 내가 로그 아웃을 클릭하면
public function mobile_logout() {
$status = true;
$event = array();
$data = array();
$this->Auth->logout();
$this->Session->setFlash('Successfully Logged out', 'flash_failure');
$this->Session->delete('Auth.Fan');
$this->set('status',$status);
$this->set('output',$data);
$this->render('/Layouts/json/mobile',false);
}
는 이제 페이지가 리디렉션되지만 메시지는 렌더링되지 않습니다. (응답을 가져 오기 전에 페이지가 다시로드됩니다). 크롬에서 요소를 검사 할 때 사용할 수있는 미리보기가없는 logout.json을 볼 수 있습니다 (컨트롤러의 json 응답이 없습니다). 어떻게 해결할 수 있습니까?
시도해 보았습니다. 다시로드하지 않았습니다. – z22