Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 从缓存浏览器显示图像_Javascript_Jquery_Asp.net_Image - Fatal编程技术网

Javascript 从缓存浏览器显示图像

Javascript 从缓存浏览器显示图像,javascript,jquery,asp.net,image,Javascript,Jquery,Asp.net,Image,或 但它仍然在后续应用程序中显示重复图像要防止页面缓存在浏览器上,请尝试将这些行添加到标题: $("#capLogin").attr("src", "Image/Captcha/CaptchaControl.aspx?id="+Math.random()); 要防止缓存,请尝试将其添加到CaptchaControl.aspx的页面加载: <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="expi


但它仍然在后续应用程序中显示重复图像

要防止页面缓存在浏览器上,请尝试将这些行添加到
标题

  $("#capLogin").attr("src", "Image/Captcha/CaptchaControl.aspx?id="+Math.random());

要防止缓存,请尝试将其添加到
CaptchaControl.aspx的
页面加载

<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="expires" content="0">

这将向浏览器发送正确的标题,要求它不要缓存内容。

可能页面本身已被缓存,您需要使用服务器端代码阻止它。
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="expires" content="0">
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetAllowResponseInBrowserHistory(false);
Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
Response.Cache.SetNoStore();