为什么我的函数 beginLoading 从不执行可见操作?
我正在使用 mootools 开发一个 ajax 上传文件,现在我尝试在 html p 标签中显示一条消息,表示正在加载,它只是一条简单的消息,每当用户按下提交按钮时就会触发,但在触发提交按钮时永远不会显示,有什么建议吗?,我不明白为什么,我也遵循教程,但我不知道,我只想用这种简单的方式,请帮助
这是我的代码:
#f1_upload_process{
z-index:100;
position:absolute;
visibility:hidden;
text-align:center;
width:400px;
margin:0px;
padding:0px;
background-color:#fff;
border:1px solid #ccc;
}
</style>
<p id="f1_upload_process">Loading...<br/></p>
<p id="result"></p>
<form method="post" action="" enctype="multipart/form-data">
<label for="file">Subir un archivo</label>
<input type="file" name="file" id="fileArchivo" />
<input type="submit" name="submit" id="btnSubir" value="upload file" />
<iframe name="iframUpload" id="iframeUpload" type="file" style="display:none"></iframe>
</form>
和我的 mootols ajax
window.addEvent("domready",function(){
cargarIndex();
});
function cargarIndex()
{
var prueboRequest = new Request({
method: 'POST',
url: '../CONTROLLER/inicio.php',
onRequest: function() {},
onSuccess: function(texto, xmlrespuesta){
document.getElementById('subirarchivo').innerHTML= texto;
$('btnSubir').addEvent('click',function(){beginUploading()});
},
onFailure: function(){alert('Error!');}
}).send();
}
function beginUploading(){
document.getElementById('f1_upload_process').style.display = "visible";
//$(''#f1_upload_process').css({display:'none'});
return true;
// return true;
}
I am developing an ajax upload file using mootools, now I am trying to display a message in a html p tag that says loading, its just a simple message that fires whenever a user press button submit but never get visible when the submit button is fired, any advise?, I dont understand why, I also follow tutorial but I dont know, I just want in this simple way, please help
this is my code:
#f1_upload_process{
z-index:100;
position:absolute;
visibility:hidden;
text-align:center;
width:400px;
margin:0px;
padding:0px;
background-color:#fff;
border:1px solid #ccc;
}
</style>
<p id="f1_upload_process">Loading...<br/></p>
<p id="result"></p>
<form method="post" action="" enctype="multipart/form-data">
<label for="file">Subir un archivo</label>
<input type="file" name="file" id="fileArchivo" />
<input type="submit" name="submit" id="btnSubir" value="upload file" />
<iframe name="iframUpload" id="iframeUpload" type="file" style="display:none"></iframe>
</form>
and my mootols ajax
window.addEvent("domready",function(){
cargarIndex();
});
function cargarIndex()
{
var prueboRequest = new Request({
method: 'POST',
url: '../CONTROLLER/inicio.php',
onRequest: function() {},
onSuccess: function(texto, xmlrespuesta){
document.getElementById('subirarchivo').innerHTML= texto;
$('btnSubir').addEvent('click',function(){beginUploading()});
},
onFailure: function(){alert('Error!');}
}).send();
}
function beginUploading(){
document.getElementById('f1_upload_process').style.display = "visible";
//$(''#f1_upload_process').css({display:'none'});
return true;
// return true;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在CSS中,您编写了
visibility:hidden;
而不是display:none;
...In css you have written
visibility:hidden;
notdisplay:none;
...