顶一下,那代码看不出什么问题啊,唯一的问题就楼上所说的,估计是楼主把script拆开显示
解决方案 »
- frame框架事件问题。
- javascript在firefox,IE下的兼容写法
- 向htmleditor中追加内容的问题
- 帮我看一下,我什么会出现out of memory at line:39错误!!
- 用WebBrowser控件怎样进行框架页面的打印预览?
- 显示图片,添加一个遮罩层,背景变灰半透明状态,点击两次遮罩层就变成全灰不透明了
- js问题 求助高手
- 为什么我网站上的图片有时可以显示,有时部份图片不能显示?
- JS能否访问本地硬盘某张图片的大小?。
- 如何用javascript给form增加一个控件?
- 怎样才能取消Scripting.FileSystemObject弹出来的提示?
- 这种数字选择器该怎么做呢
<form name="form1" method="post" enctype="multipart/form-data" target="targetFrame">
<input type="file" NAME="files" onchange="metho1()">
<input type="button" name="button" onclick="metho2()"/>
</form>
<iframe name="targetFrame" width="300" height="300"> </iframe>
</html>
<script>
function metho1(url){
document.form1.action = '/metho1.do?.....';
document.form1.submit();
} function metho2(url){
document.form1.action = '/metho2.do?.....';
document.form1.submit();
} </script>为了看到效果我把width="300" height="300"加了,测试没有你说的情况,至少在IE6下没有
其他的我没测试
把你的代码放到环境里或把提交地址改成相对路径
这样: (放环境里按你写的就行)
<html>
<body>
<form name="form1" action="xx" method="post" enctype="multipart/form-data">
<input type="file" NAME="files" onchange="metho1()">
<input type="button" name="button" onclick="metho1()" value="metho1" />
<input type="button" name="button" onclick="metho2()" value="metho2" />
</form>
<iframe name="targetFrame" width="0" height="0"> </iframe>
</body>
</html>
<script>
function metho1(url){
document.form1.action = 'metho1.do?.....';
document.form1.submit();
} function metho2(url){
document.form1.action ='metho2.do?.....';
document.form1.submit();
}
</script>
<form id="form1" name="form1" method="post" enctype="multipart/form-data" target="targetFrame">
<input type="file" NAME="files" onchange="metho1()">
<input type="button" name="button" onclick="metho2()"/>
</form>
<iframe name="targetFrame" width="0" height="0"> </iframe>
</html>
function metho1(url){
document.getElementById("form1").action = '/metho1.do?.....';
document.form1.submit();
} function metho2(url){
document.getElementById("form1").action = '/metho2.do?.....';
document.form1.submit();
} 加个id如何呢?
<html>
<form name="form1" method="post" enctype="multipart/form-data" target="targetFrame">
<input type="file" NAME="files" onchange="metho1()">
<input type="button" name="button" onclick="metho2()"/>
</form>
<iframe name="targetFrame" width="300" height="300"> </iframe>
</html>
<script>
function metho1(url){
document.form1.action = 'http://g.cn';
document.form1.submit();
} function metho2(url){
document.form1.action = 'http://www.baidu.com';
document.form1.submit();
} </script>
测试过,ff下也没有异常