简体   繁体   中英

clear iframe cache issue in IE9

I am using iframe to load pdf. $('#iframe01').attr('src', url);

Everytime when loading new pdf file, it shows the old one for a very short period of time.

So, I am using $('#iframe01').find('body').html('') to clear the previous cached pdf when user click the different pdf file, it is working fine in Chrome.

However, when I test it in IE9, after opened the pdf and closed it, when click 2nd file, in console, it is saying: No such interface supported and crash.

Any reason for this happen?

好的, contentWindow.document.body.innerHTML = ''修复。

Try to add some extra data's in your URL like

$('#iframe01').attr('src', url + "?date="+new Date().getTime() );

this will be considered as every time the new url comes and erase the old data.

Hope this helps. But not tested.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM