我有一个包含
对于一些用户,当他们点击打开文件对话框的按钮时,它并没有出现。问题不是基于浏览器,因为遇到这个问题的计算机使用所有安装的浏览器都无法打开文件对话框,如Chrome、Firefox和Internet Explorer。
问题也不是基于操作系统,因为我已经在以下操作系统中遇到了此问题:
• Windows XP • Windows 7 • Kubuntu 11.04
我已经在这些操作系统上安装了虚拟机,文件对话框完美运行。
所以我的问题是:有人知道这到底是怎么回事吗?
以下是代码:
<form>
和<input type=file
>的jquery-ui-dialog。对于一些用户,当他们点击打开文件对话框的按钮时,它并没有出现。问题不是基于浏览器,因为遇到这个问题的计算机使用所有安装的浏览器都无法打开文件对话框,如Chrome、Firefox和Internet Explorer。
问题也不是基于操作系统,因为我已经在以下操作系统中遇到了此问题:
• Windows XP • Windows 7 • Kubuntu 11.04
我已经在这些操作系统上安装了虚拟机,文件对话框完美运行。
所以我的问题是:有人知道这到底是怎么回事吗?
以下是代码:
<meta charset="utf-8">
<link rel="stylesheet" href="http://matchfwd-statics.s3-website-us-east-1.amazonaws.com/asset_cache/css/e1b34bd841d9.css" type="text/css" media="all">
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js'>
<script>
$(function() {
$( "#dialog-form" ).dialog({
autoOpen: false,
height: 500,
width: 550,
modal: true,
buttons: {
"Send": function() {
$( this ).dialog( "close" );
},
Cancel: function() {
$( this ).dialog( "close" );
}
},
close: function() {
allFields.val( "" ).removeClass( "ui-state-error" );
} });
$( "#create-user" ) .button() .click(function() { $( "#dialog-form" ).dialog( "open" ); });
});
</script>
<div class="demo">
<div id="dialog-form" title="Create new user">
<p class="validateTips">All form fields are required.</p>
<form class="main-form" method="post" action="" enctype="multipart/form-data">
<h3>Fill in some details</h3>
<span class="title">Your profile will be submitted with your application:</span><br/>
<div class="holder" style="position:relative;top:12px"><a style="color:#24c2c9;" href="></a></div>
<br>
<span class="title">Why would you be the right candidate?</span><br/>
<div class="holder"><textarea class="" name="description" cols="58" rows="10"> </textarea></div>
<span class="note"></span>
<span class="title">Attachments <a href="#" id="add_attachment" class="plus"> </a></span>
<div id="attachments" class="holder"></div>
</form>
</div>
<button id="create-user">Create new user</button>
<script type="text/javascript">
(function() {
var counter=1;
$("#add_attachment").click(function(e){
e.preventDefault();
var attachmentString = 'attachment-'+counter
var inputString = '<input type="file" name="'+attachmentString+'" id="id_'+attachmentString+'" />'
$(inputString).appendTo("#attachments")
counter = counter+1
})})();
</script>
<input type="file">
,对吧?它发生在我的Google Chrome(14.0.835.29 dev)上,它不会打开文件对话框。但是Firefox正常工作。 - ace