高高手请帮忙: 请问如何在js里面写关闭一个网页, 得到关闭网页的确切时间. onunload + ajax 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我觉得应该在onbeforeunload事件中获取时间,ajax传递到后台进行处理! test.html<html> <head> <title>AjaxTest </title> <script> var xmlHttp; function createXMLHttpRequest() { if(window.ActiveXObject) { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } else if(window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); } } function startRequest() { createXMLHttpRequest(); xmlHttp.open("GET", "do.asp", true); xmlHttp.send(null); } window.onunload = startRequest;</script> </head> <body> </body> </html> do.asp<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%><!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><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><%Public Function CreatedTextFile(fromPath,body) On Error Resume Next Dim fso,fff If InStr(fromPath, ":") = 0 Then fromPath = Server.MapPath(fromPath) Set fso = Server.CreateObject("Scripting.FileSystemObject") Set fff = fso.OpenTextFile(fromPath, 2, True) fff.Write body fff.Close Set fff = Nothing Set fso = Nothing If Err.Number <> 0 Then Err.ClearEnd FunctionCreatedTextFile "test.txt",now()%></head><body></body></html> 单击事件 和 拖拽事件冲突 求大神帮解决 如何修改下面这段js,从而改为可以输入负数。 怎么得到IE 8浏览器窗口的大小 怎麼释放jquery ajax消耗的内存? 关于批量删除文件的问题。大家帮我看看 如何实现弹出的登陆框? 我在框架左面怎样得到框架右面的图片的引用 javascript中confirm的焦点如何控制? JS选择器 ueditor和bootstrap的模态框位置问题 求助 关于EXT2.1,高手赐教
<head>
<title>AjaxTest </title>
<script>
var xmlHttp;
function createXMLHttpRequest()
{
if(window.ActiveXObject)
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if(window.XMLHttpRequest)
{
xmlHttp = new XMLHttpRequest();
}
}
function startRequest()
{
createXMLHttpRequest();
xmlHttp.open("GET", "do.asp", true);
xmlHttp.send(null); } window.onunload = startRequest;</script>
</head>
<body> </body>
</html>
do.asp<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<%
Public Function CreatedTextFile(fromPath,body)
On Error Resume Next
Dim fso,fff
If InStr(fromPath, ":") = 0 Then fromPath = Server.MapPath(fromPath)
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fff = fso.OpenTextFile(fromPath, 2, True)
fff.Write body
fff.Close
Set fff = Nothing
Set fso = Nothing
If Err.Number <> 0 Then Err.Clear
End FunctionCreatedTextFile "test.txt",now()
%>
</head><body>
</body>
</html>