■49085 / inTopicNo.2) |
Re[1]: IE8でwebmethodの動きについて |
□投稿者/ 北村 正治 (2回)-(2010/04/21(Wed) 20:37:01)
|
再現するソースを載せます
■Default2.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %>
<!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">
var endFlg = false;
function InputCheck() {
endFlg = false;
PageMethods.InputCheck(OnSuccess);
Wait();
return;
}
function OnSuccess() {
endFlg = true;
}
function Wait() {
/* alert('中断');*/
while(endFlg==false) {
Sleep();
}
return;
}
function Sleep() {
var xmlHttpObj=null;
if (typeof ActiveXObject != "undefined") {
var msXml = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP'];
for (var ci=0; ci < msXml.length; ci++ ) {
xmlHttpObj = new ActiveXObject(msXml[ci]);
if (xmlHttpObj) break;
}
}
else if (typeof XMLHttpRequest != "undefined") {
xmlHttpObj = new XMLHttpRequest();
}
if (!xmlHttpObj) return;
xmlHttpObj.open('GET', './Sleep.aspx?time=' + (new Date()).getTime(), false);
xmlHttpObj.send(null);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="True"></asp:ScriptManager>
</div>
<asp:Button ID="Button1" runat="server" Text="Button" UseSubmitBehavior="False" OnClientClick="InputCheck();" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</form>
</body>
</html>
|
|