숨겨진 iFrame을 사용하여 꽤 오래 전에 내 사이트에 ajax 파일 업로드를 추가했습니다. 내 사이트에서 jQuery를 사용하면 정말 빠르게 작업 할 수 있습니다. 문제를 해결할 수는 없지만 iFrame에서 새로운 아약스 요청을 할 때마다 요청한 페이지가 브라우저 기록에 추가됩니다. 나는이 주제에 대해 많은 질문을하고 있지만 충분한 대답을 찾을 수는 없다는 것을 알고 있습니다.숨겨진 iFrame : 기록에 표시 안 함 [jQuery]
내 jQuery 코드 :
내가#post_form
에 내 양식의 대상 속성을 설정 한 내 HTML 코드에서
$(document).bind('ready', function() {
// Add the iFrame to the DOM (iFrame is needed because of file uploads).
$('body').append('<iframe id="post_form" name="post_form" style="display: none;" src="javascript:false"></iframe>');
// Show forms on click.
$('a.own, a.sale, a.spotted').bind('click', function(event) {
// Animate and clear the boxes.
$('.box').slideFadeOut(300);
$('form.' + $(this).attr('class') + ':hidden').delay(300).slideFadeIn(300)[0].reset();
return false;
});
// Get the form response (from iFrame because of file uploads).
$('iframe#post_form').bind('load', function() {
var response = $(this).contents().find('body').html()
if (response.length) {
$('div#message').html(response).animate({
opacity: 'show',
height: 'show',
borderWidth: '1px'
}, 300);
} else {
$('.box').slideFadeOut(300);
}
});
});
. 또한 모든 요청에 대해 새 iFrame을 만들거나 frame.location을 수동으로 설정하려고했지만 파일 업로드와 함께 작동하지 못했습니다. 누구든지 도와 줄 수 있습니까?
감사합니다.
기록에 해당 페이지가있는 것이 정확히 무엇입니까? –
브라우저의 뒤로 버튼이 깨져서 사용자가 알지도 못하는 기록의 페이지를 볼 수 있습니다. – Frog
제가보기에 문제는 당신이 ** 아약스를 사용하지 않는다는 것입니다. 보통 양식을 제출하면 역사가 커질 것입니다. 플래시 업 로더를 사용하면 역사에 영향을주지 않아야합니다. –