이 함수는 아약스 ... 모든 것이 잘 작동합니다.
$ 사용자를 다시로드하려면 동일한 $ 사용자를 반환하십시오.
$ 사용자에게 새 데이터를 다시로드하기 위해 아약스를로드 한 후에는 어떤 방법이 있습니까? 당신은 기능 전에 VAR를 선언하고 VAR를 덮어 쓰기한다페이지를로드 한 후 변수를 다시 채우는 방법
컨트롤러
function list_of_users_by_skills($project_ids){
$project_id = json_decode($project_ids);
/* Generate Users by Skills
* By Isaac
*/
$this->loadModel('Training');
//Get list of users by skills
$users_return = $this->Training->find('all', array('conditions' => array('Training.Project_id' => $project_id)));
//some code here to return the $users :)
asort($users);
$this->set('users', $users);
}
보기
var page = 'http://localhost/index.php/shifts/list_of_users_by_skills/[176,196]/';
console.log(page);
$.ajax({
url: page,
success: function(data) {
<?php echo "var user_array = [" . json_encode($users) . "];\n"; ?>
console.log(user_array);
console.log(<?php echo json_encode($users); ?>);
}
});
Yeyyyy !!!!!! 감사합니다. 다른 HTML 태그를 얻기 전에 HTML 태그를 인쇄했습니다. 그것은 매력처럼 작동합니다. ;) – Fury
@Vahid Rajaei 듣기 좋은 분 :-) – jeroen