<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title> New Document </title>
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <script type="text/javascript">
//或者在body里加个onload方法
window.onload=function(){
var num=prompt("您打算显示多少张图片","")-0;
for(var i=1;i<num+1;i++){
var im=document.createElement("img");
//怎么能让src可以匹配所有图片而不是固定的“i.gif”?
im.src=i+".gif";
    //document.body.appendChild(im);
document.getElementsByTagName("body")[0].insertBefore(im,document.getElementById("in"));
if((i%5)==0){
var br=document.createElement("br");
document.body.insertBefore(br,document.getElementById("in"));
}
}
/**
var inpu=document.createElement("input");
inpu.type="file";
document.body.appendChild(inpu);
inpu.onchange="showPic(this)";//火狐上不能这样写,应写成下面这种形式
//inpu.setAttribute("onchange","showPic(this)");
*/
}
function showPic(t){
    var imgl=document.createElement("img");
alert(t.value);
imgl.src=t.value;//IE6是全路径,IE7/IE8/FF为了安全只显示文件名
/**以下参考网上的,但是不管用
//判断浏览器类型
var isIE=(document.all)?true:false;
var isIE7=isIE&&(navigator.userAgent.indexOf('MSIE 7.0')!=-1);
var isIE8=isIE&&(navigator.userAgent.indexOf('MSIE 8.0')!=-1);
if(isIE7||isIE8){
t.select();
var path=document.selection.creatRange().text;
document.selection.empty();
imgl.src=path;
}
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
}catch(e){
//alert("请更改浏览器设置");
//return;
}
var fname=t.value;
var file=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
try{
file.initWithPath(fname.replace(/\//g,"\\\\"));
}catch(e){
if(e.result!=Components.results.NS_ERROR_FILE_UNRECOGNIZED_PATH) throw e;
alert('无法加载文件');
return;
}
//imgl.src=file.path;
imgl.src=t.value;*/
document.body.insertBefore(imgl,document.getElementById("in"));
//document.body.appendChild(imgl);
}
</script> </head> <body >
  <input id="in" type="file" onchange="showPic(this)">
 </body>
</html>
如题:
1.怎么匹配本地相同文件夹下所有图片?
2.火狐里怎么获得上传图片的全路径?