javascript的简单问题!!!
1 .btn_upload.Attributes.Add( "onclick " , " if(!ShowSize()){alert( '对不起,您的文件大于200M不可以上传! '); return false ;}else{return true;}; ");
2.btn_upload.Attributes.Add( "onclick " , "if(!getExtension()){alert( '对不起,此格式文件不可以上传! '); return false ;}else{return true;}; ");
AspnetUpload upldr = new AspnetUpload();
upldr.RegisterProgressBar();
string fpath = Path.Combine(Server.MapPath( ". "), "Upload ");
if(!Directory.Exists(fpath))
Directory.CreateDirectory(fpath);
upldr.set_UploadFolder(fpath);
string str = upldr.get_UploadID();
3.btn_upload.Attributes.Add( "onclick ", "showProgressBar( 'ProgressBar.aspx?UploadID= "+upldr.get_UploadID()+ " '); ");
为什么 btn_upload.Attributes.Add( "onclick ", "showProgressBar( 'ProgressBar.aspx?UploadID= "+upldr.get_UploadID()+ " '); ");
不执行啊!这是前台的脚本function showProgressBar(url)
{
var ary = document.getElementsByTagName( 'input ');
var openBar = false;
for(var i=0;i <ary.length;i++)
{
var obj = ary[i];
if(obj.type == 'file1 ')
{
if(obj.value != ' ')
{
openBar = true;
break;
}
}
}
if(openBar)
{
showPopWin(url, 400, 200, null);
}
}
拜托了哦!!!!
------解决方案--------------------错误提示是什么?
------解决方案--------------------我帮你顶吧 `` 不明白你为什么onclick事件添加两次。