就像迅雷下载时 选择下到D:\或E:\的对话框 怎么实现
解决方案 »
- 可以拉伸的div
- javascript的使用。
- 光标的问题,说难有点难,可能无法实现,但说不定也很简单
- Mozilla中,页面写脚本就可以,包含脚本文件就不行,怎么办呀?
- select控件改变了选项 是触发什么事件啊
- 谁有微软的Dynamic HTML Editing Component SDK,在微软网站上找不到
- 如何表示带变量的表单对象的名字??急!!
- 确定和取消都被删除了?WHY
- 请问Visual Studio.NET 中的JavaScript.NET和JavaScript是什么关系
- Cookie的有效范围问题
- 校验Text输入框的程序,请教
- 谁能解析下js getcookie 的正则?
<INPUT onclick="document.execCommand('saveas','true','11.htm')" type=button value="另存为"/>
input file 是要选择文件的 听他的意思 只要选择 一个路径
弹出对话框选择路径就行啊
JQuery版,这个是你要的效果,,,
ps:其实一个file就能解决。
<!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></title> <script src="lib/jquery-1.4.2.js" type="text/javascript"></script> <script type="text/javascript">
$(document).ready(function() {
$(":button").click(function() {
$(":file").click();
$(":text").val($(":file").val());
});
});
</script></head>
<body>
<input type="button" value="选择文件" />
<input type="file" style="display: none;" />
<input type="text" />
</body>
</html>
给个例子function browseFolder(path) {
try {
var Message = "请选择路径"; //选择框提示信息
var Shell = new ActiveXObject("Shell.Application");
var Folder = Shell.BrowseForFolder(0, Message, 64, 17);//起始目录为:我的电脑
if (Folder != null)
{
Folder = Folder.items(); // 返回 FolderItems 对象
Folder = Folder.item(); // 返回 Folderitem 对象
Folder = Folder.Path; // 返回路径
if (Folder.charAt(Folder.length - 1) != "\\")
{
Folder = Folder + "\\";
}
document.getElementById(path).value = Folder;
return Folder;
}
}
catch (e)
{
alert(e.message);
}
}
但这个方法需要放开ie的权限,我不能去帮每个用户都开发权限吧