Home > Web Front-end > JS Tutorial > IE8 local image upload preview sample code_javascript skills

IE8 local image upload preview sample code_javascript skills

WBOY
Release: 2016-05-16 17:04:05
Original
1039 people have browsed it
Copy code The code is as follows:

imgpath= getRealPath(fileId);

document. getElementById("divSBTP").style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true',sizingMethod='scale',src="" imgpath "")";//Use filter effects

function getRealPath(fileId){

var file_upl = document.getElementById(fileId);

file_upl.select();

return document.selection.createRange ().text;
}

Note: ie8 local image upload preview cannot directly use $("#img").attr("src",imapath) because of restrictions on browser access Local files, so filters and divs are used. If filters and img are used, a broken image mark will appear.
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template