Skip to content

Instantly share code, notes, and snippets.

@taka2
Created March 4, 2011 07:26
Show Gist options
  • Select an option

  • Save taka2/854301 to your computer and use it in GitHub Desktop.

Select an option

Save taka2/854301 to your computer and use it in GitHub Desktop.
<%@ Language = "VBScript" %>
<html>
<head>
<meta http-equiv = "Content-Type" content = "text/html; charset = Shift_JIS">
<title>VBScript Ajax Test</title>
<script language = "VBScript">
Dim xhr
Sub btn1_onclick()
Set xhr = CreateObject("Microsoft.XMLHTTP")
xhr.open "GET", "/test.asp", true
xhr.onreadystatechange = GetRef("handler")
xhr.send
End Sub
Sub handler()
If xhr.readystate = 4 Then
document.getElementById("result").innerHtml = xhr.responseText
End If
End Sub
</script>
</head>
<body>
<form name = "form1">
<input type = "button" id = "button1" name = "btn1" value = "ボタン">
<span id = "result"></span>
</form>
</body>
</html>
<!--
test.aspの中身は以下の通り。
<%@ Language = "VBScript" %>
<%
Response.Write("hoge")
%>
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment