在点击保存时 IE 总是关闭 ("如果你正处于进程当中,信息有可能丢失")
如果想测试 相关的几个页面还没有处理过
我的ie是 7.0
show_word() 这个运行没有问题
当程序运行完Submit_upload_onclick 就出以上问题了
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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 runat="server">
<title>无标题页</title>
<script type="text/javascript">
function show_word()
{
var str=window.location.search;
// var pos_start=str.indexOf("id")+3;
// if(pos_start==2)
return ;
var id = "http://localhost/Getdc.aspx?id=" + str.substring(pos_start);
document.all.MyOffice.Open(id,false ,"Word.Document");
}
function Submit_upload_onclick()
{
// var str=window.location.search;
var str ="id=1";
var pos_start=str.indexOf("id")+3;
// if (pos_start == 2)
// return ;
document.all.MyOffice.HttpInit();
document.all.MyOffice.HttpAddPostCurrFile("File", "");
var id = "http://localhost/Savedc.aspx?id=" + str.substring(pos_start);
document.all.MyOffice.HttpPost(id);
}
</script>
</head>
<body onload="show_word();">
<form id="form1" runat="server">
<div>
<object id="MyOffice" name="MyOffice" style="left: 0px; width: 100%; top: 0px; height: 100%" classid="clsid:00460182-9E5E-11D5-B7C8-B8269041DD57" codebase="dsoframer.ocx#version=2,2,0,0" ></object>
<input id="Button1" type="submit" value="保存" onclick="return Submit_upload_onclick()" />
<input type="file" name="File" id = "File"/>
</div>
</form>
</body>
</html>
onclick="return Submit_upload_onclick()" />
这句貌似得写成onclick="Submit_upload_onclick()"
onclick="return Submit_upload_onclick()"
return 了什么呢