Atitit. IE8.0: Display local image preview solution img. src = the local image path is invalid,
Atitit. IE8.0 display local image preview solution img. src = the local image path is invalid Solution
1. IE8.0 display local image img. src = the local image path is invalid solution 1
1.1. div to complete. Filter1
1.2. If it is a local html, it seems that the relative path is not enough. 2
1.3. URL. createObjectURL (ma sida) 2
1.4. Css background () 2
2. This is Data URI scheme. 2
3. -- code2
4. Refer to 2
1. IE8.0: Solution for displaying the local image img. src = the local image path is invalid
Category:. net development 1419 people read comments (0) collect reports
1.1. Div. Filter
IE8.0 the local image img. src = the local image path is invalid and can only be used by div. Filter
Upload the image to the server, and set the relative path returned by the Service in attr.
The browser does not seem to allow you to preview local files on your computer.
Js in ie6 and 7 browsers does not support using the setattribute () method to modify the value in src or the type attribute of input, because this will cause security questions.
Author: old wow's paw Attilax iron, EMAIL: 1466519819@qq.com
Reprinted please indicate Source: http://www.cnblogs.com/attilax/
1.2. If it is a local html file, it seems that the relative path is not used.
Self-powered server path ?? Check whether base64 is missing
1.3. URL. createObjectURL (ma sida) 1.4. Css background () 2. This is Data URI scheme.
Data URI scheme is defined in RFC2397 to embed small Data into a webpage without loading it from an external file. For example, the string above is actually a small image. copy and paste these characters into the address bar of Firefox and go to it to see it, a 1x36 white-gray png image.
3. -- Code
Prj. atibrow. captxGui
Byte [] read4img = filex. read4img (destFile. getAbsolutePath ());
String base = Base64.encode (read4img, false );
Rzt = "data: image/jpeg; base64," + base;
String call = (String) mp. get ("$ callback ");
String js2 = call + "('" + rzt + "');";
Boolean rzt2effecef.atibrowserexampleinstance.exe cuteJsTxt (js2 );
4. Reference
Html img Src base64 Image Display
Atitit. javascript js File Upload preview .doc