<script language="javascript" type="text/javascript">
function add() {
var file=document.createElement("<input type='file' name='detailpic[]' />");
var btn=document.createElement("<input type='button' value='删除' onclick='this.parentNode.parentNode.remove(currentTarget)' />");
var newtd=document.createElement("td");
var newtr=document.createElement("<tr></tr>");
newtd.appendChild(file);
newtd.appendChild(btn);
newtr.appendChild(newtd);
var filearea=document.getElementById("filearea");
filearea.appendChild(newtr);
}
function clear() {
removeChild(currentTarget);
}
</script>
<table border="0" width="100%">
<tbody id="filearea">
<tr>
<td><input type="file" name="detailpic[]" /> <input type="button" onclick="add();" value="添加" /></td>
</tr>
</tbody>
如果不用createElement的方式,而换成innerHtml迭加的方式,正常,但是添加file时,原来的file的路径值就消失了。
<script language="javascript" type="text/javascript">
var i=1;
function append() {
i++;
var picarea=document.getElementById("detailPicArea");
picarea.innerHTML+="<div id=detailpicnew"+i+"><input type='file' name='detailpic[]' /> <input type='button' onclick='del("+i+");' value='删除' /></div>";
}
function del(i) {
var parent=document.getElementById("detailPicArea");
var detailpicnew=document.getElementById("detailpicnew"+i);
parent.removeChild(detailpicnew);
}
</script>
<td id="detailPicArea">
<div><input type="file" name="detailpic[]" /> <input type="button" onclick="append();" name="btnfileadd" value="添加" /></div>
</td>
终级解决方案是用ajax上传,这样编辑修改记录时思路也更加清晰。
分享到:
相关推荐
百度地图切图工具ie内核、chromium内核
众所周知, chromium 是多进程框架的,整个 chromium 浏览器包括四类进程: browse 主进程、 render 渲染进程、 GPU 进程和插件进程。本文所要讲述的 chromium 事件处理流程 主要牵涉到其中的两种进程: browser ...
断断续续下载chromium代码花了1周左右,代码约15G左右,其中遇到power shell的问题,遇到python的问题。最终编译花了11:30分。相比于Linux下的编译慢很多,系统运行的稳定性和速度也差很多。打算研究源码,一起分享...
ungoogled-chromium是Google Chromium,不依赖于Google Web服务。 ungoogled-chromium尽可能保留默认的Chromium体验。与其他具有Web浏览器愿景的其他Chromium分支不同,ungoogled-chromium本质上是Chromium的直接...
webkit 内核 js扩展demo . 基于chromium53,支持扩展私有JS接口 。一种JS c++ 相互调用的方式。
MFC下Chromium的嵌入
chromium命令行参数1
chromium-linux.zip
SwitchyOmega-Chromium
chromium离线安装版49 x86 32位windows xp 2003 亲测好用.chromium 不会默认上传您的用户数据,且性能比同版本chrome强10%。差不多可以说算得上是xp 2003 下最好用的 浏览器了
ungoogled-chromium是Google Chromium,不依赖于Google Web服务。 ungoogled-chromium尽可能保留默认的Chromium体验。与其他具有Web浏览器愿景的其他Chromium分支不同,ungoogled-chromium本质上是Chromium的直接...
ByteCub物联网平台PC WEB UI,目前只支持chromium内核浏览器,在IE下部分页面显示会失真。在vue.config.js中修改管理后台请求地址,默认为http://127.0.0.1:8080/。node版本为v14.16.0,如果其他版本请修改node-saas...
该文件属于Chromium 58版本的编译配置文档,其中,包含每一项参数的说明。 请注意,该文档是通过gn args --list out/debug生成的,如果你已下载Chromium源码,可以手动生成,不必下载。
开启方法添加工程文件添加 procedure AppendCefCmdline(const processType: ustring; const cmd: ICefCommandLine); begin cmd.AppendSwitch('enable-npapi'); cmd.AppendSwitchWithValue('ppapi-flash-path','...
Chromium(谷歌浏览器)是一款可让您更快速,轻松且安全地使用网络的浏览器,设计超级简洁,使用起来更加方便。浏览器Chrome的特点是简洁,快速。支持多标签浏览,每个标签页面都在独立的“沙箱”内运行,在提高安全性的...
与主要关注谷歌Chrome应用程序开发的Chromium项目本身不同,CEF主要是促进在第三方应用程序中去嵌入浏览器使用。CEF通过提供产品质量稳定的api、发布跟踪特定的Chromium版本的分支和二进制发行版,将用户与底层的...
SwitchyOmega_Chromium插件
Chromium Nightly Updater 1.1
Chromium网页渲染技术,更多信息点击进入:http://0xcc0xcd.com
LICENSES.chromium