0
나는 아약스가 완료 될 때 이미지를 반환 노력하고 있어요,하지만 난이 응답 세션 변수를 포함하는 방법을 모른다는,이 내 코드 포함
<?php
// using time() as the cache buster, the image will never be cache by the browser
// to solve it, you need to add condition that will check if the image has change or not.
// or maybe you need to change the filename if it changes without adding a cache buster.
echo $_SESSION['sess_img_chofer']."?v=".time();
그리고 당신의 자바 스크립트 : 그럼, 당신은 다음과 같이 process.php
에서 해당 이미지 파일 이름을 에코 할 수 #new-image
HTML 삽입시주의해야합니다. 나는 $ ('# new-image')와 같은 것을 쓸 것이다. empty() .attend ($ ('') .attr ('src', 'uploads/img /'+ image) .attr 'class', 'img-upload'))' – Phil
@ vher2 이것은 잘 진행 중이며 문제는 새로운 이미지를 업데이트하지 않는다는 것입니다. 새로운 아이디어를 내놓으려면 F5를 사용해야합니다. – GePraxa
이것은 오래된 이미지'$ _SESSION [ 'sess_img']'입니까? – vher2