87,993
社区成员
发帖
与我相关
我的任务
分享<img id="img" src="abc.gif" style="width:100px; height:100px; border:1px solid #000;"/>
<script type='text/javascript' src="img.js" language="javascript"></script>
/* <---------------------------- 这里必须 js 文件的首行
Content-Type: multipart/related; boundary="_cn_ialvin_web_script_javascript_"
--_cn_ialvin_web_script_javascript_
Content-Location:blankImage
Content-Transfer-Encoding:base64
R0lGODlhAQABAJEAAAAAAP///////wAAACH5BAEAAAIALAAAAAABAAEAAAICVAEAOw==
*/
function map(path) {
if (/^http\:\/{2}/i.test(path)) return path;
return "http://" + location.host
+ ((/^[\/]/.test(path))? "" : location.pathname.replace(/[^\/]*$/,'')) + path;
}
var currentScript = document.scripts[document.scripts.length-1];
!function() {
var img = document.getElementById("img");
if (/\bmsie [67]/i.test(window.navigator.userAgent)) {
img.src = ("mhtml:" + map(currentScript.src) + "!blankImage");
} else {
img.src = "data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///////wAAACH5BAEAAAIALAAAAAABAAEAAAICVAEAOw==";
}
}();
<img width="100" height="100" border="1" src="data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///////wAAACH5BAEAAAIALAAAAAABAAEAAAICVAEAOw==" /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta name="generator" content="editplus" />
<meta name="author" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
</head>
<body>
图前边<img id="imgTest" width="200" height="100" alt="" />图后边
<script type="text/javascript">
<!--
var img = document.getElementById("imgTest");
img.style.visibility = "hidden";
img.onload = function() {
// Insert your code.
this.style.visibility = "visible";
// Insert your code.
};
// Change your image url.
img.src = "fontBoldSample.jpg";
//-->
</script>
</body>
</html>