
var new_element = document.createElement("script")//创建新的script节点new_element.setAttribute("type", "text/javascript")new_element.setAttribute("src", "../js/jquery.js")document.body.appendChild(new_element)//添加到body节点的末尾
上例中是在body的最末尾添加的,当然同样可以在head中添加引用该js的标签:document.head.appendChild(new_element)
不知道你服务器端用什么语言处理的?
C#里面处理过,可以用request.files获得所有上传文件(HttpPostedFile
)的一个集合,你可以查一下msdn:http://msdn.microsoft.com/zh-cn/library/system.web.httprequest.files(v=VS.80).aspx
string savePath = @"d:\upload"for(HttpPostedFile f in request.files){
string fileName = f.FileName
f.SaveAs(path.Combine(savepath,fileName))
}
其他语言应该也有类似的对象来处理吧.
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)