我正在使用这个标题(见下文).那么为什么我的页面会继续在IE上缓存???
<!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" />
<META NAME="MSSmartTagsPreventParsing" CONTENT="True">
<META HTTP-EQUIV="Expires" CONTENT="0">
<META HTTP-EQUIV="Pragma" CONTENT="No-Cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="No-Cache,Must-Revalidate,No-Store">
<META NAME="Robots" CONTENT="NoIndex,NoFollow">
<META ondragstart="return false" onselectstart="return false" http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
Run Code Online (Sandbox Code Playgroud)
问题解决了!!!而不是.html或.htm使用.php并使用像这样的php标头:
<?php
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache, no-store, must-revalidate");
header("Pragma: no-cache");
?>
Run Code Online (Sandbox Code Playgroud) 我在C#中看到了这一行,我正在尝试将其改编为VBA:
Microsoft.Win32.Registry.SetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR", "Start", 4,Microsoft.Win32.RegistryValueKind.DWord);
Run Code Online (Sandbox Code Playgroud)
我在这里迷失了一些错误:
运行时:5 - 程序调用无效)
当我使用默认的i_Type字符串"REG_SZ"而不是"Start"时,我得到一个与regkey相关的错误:
运行时 - -2147024891 [80070005]无效的根
我的代码:
Dim i_RegKey As String, i_Value As String, i_Type As String
Dim myWS As Object
i_Type = "REG_SZ" ' Optional
'access Windows scripting
Set myWS = CreateObject("WScript.Shell")
'write registry key
i_RegKey = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR\Start"
i_Value = "4"
i_Type = "REG_DWORD"
myWS.RegWrite i_RegKey, i_Value, i_Type
Run Code Online (Sandbox Code Playgroud) 这个脚本给我一个错误,因为它消耗了太多的资源.我该怎么做才能解决这个问题?
Dim oSht As Worksheet
Dim i As Long, j As Integer
Dim LRow As Long, LCol As Long
Dim Email1Col As Integer, Email2Col As Integer, Email3Col As Integer
Dim arr As Variant
Dim SplEmail3 As String
'Definitions
Set oSht = ActiveSheet
Email1Col = 6
Email2Col = 7
Email3Col = 8
'-----------
With oSht
'LRow = .Range("G" & .Rows.Count).End(xlUp).Row
LRow = 1048576
'LCol = .Cells(1, .Columns.Count).End(xlToLeft).Column
End With
For i = 2 To LRow
'If oSht.Rows(i + 1).EntireRow = 0 …
Run Code Online (Sandbox Code Playgroud) 我需要将变量传递给另一个函数,但它不会返回任何东西.注意:它不会向外部返回任何内容,但如果我在函数内部执行document.write,它可以完美地工作..
<script type="text/javascript">
//funtion1
if (navigator.geolocation){
navigator.geolocation.getCurrentPosition(Location);
}
function Location(position){
var latitude = position.coords.latitude;
var longitude = position.coords.longitude;
return (latitude,longitude);
}
//function2
function initialize() {
document.write(latitude);
document.write(longitude);}
</script>
Run Code Online (Sandbox Code Playgroud) 我正在使用此功能来检查网页是否存在.为此,我正在检查它是否有标题.但我总是得到404,即使有一个空白的网址..我在这里做错了什么?
var xmlhttp;
function checkURL(url){
xmlhttp=null; // initialize the request object
// All the browsers except for the old IE
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest()
xmlhttp.onreadystatechange=xmlhttpChange
xmlhttp.open("HEAD",url,true)
xmlhttp.send(null)
}
// old IE
else if (window.ActiveXObject)
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
if (xmlhttp)
{
xmlhttp.onreadystatechange=xmlhttpChange
xmlhttp.open("HEAD",url,true)
xmlhttp.send();
}
}
}
function xmlhttpChange()
{
// if loaded
if (xmlhttp.readyState==4)
{
// if head exists "OK"
if (xmlhttp.status==200)
{
alert('URL exists')
}
else
{
alert("Status is "+xmlhttp.status)
}
}
}
Run Code Online (Sandbox Code Playgroud) 当我打开这个网址时,我收到了这个回复:
r = Request(r'http://airdates.tv/')
h = urlopen(r).readline()
print(h)
Run Code Online (Sandbox Code Playgroud)
响应:
b'\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x00\xed\xbdkv\xdbH\x96.\xfa\xbbj\x14Q\xaeuJ\xce\xee4E\x82\xa4(9m\xe7\xd2\xd3VZ\xaf2e\xab2k\xf5\xc2\n'
Run Code Online (Sandbox Code Playgroud)
这是什么编码?有没有办法根据标准库解码它?
提前感谢您对此事的任何见解!
PS:好像是gzip.
此函数应将页面上花费的时间写入div.它的工作正常,有一个window.onbeforeunload警告..那么为什么这不正常呢?
<script>
function tempo1() {
var d1 = new Date();
var t_day = d1.getDate();
var t_hour = d1.getHours();
var t_min = d1.getMinutes();
var t_sec = d1.getSeconds();
alert("Started at--> " + t_day + "days, " + t_hour + ":" + t_min + ":" + t_sec);
function tempo2() {
var d2 = new Date();
var t_day2 = d2.getDate();
var t_hour2 = d2.getHours();
var t_min2 = d2.getMinutes();
var t_sec2 = d2.getSeconds();
var day = t_day2 - t_day;
var hour = t_hour2 - t_hour; …
Run Code Online (Sandbox Code Playgroud)