[英]Web browser cache clean while javascript development
I am developing javascript code with visual studio. 我正在用Visual Studio开发JavaScript代码。 Everything is working wWhen I run the application first, then I changing some value of javascript variable but browser not showing right result.
一切正常w当我第一次运行应用程序时,然后更改了javascript变量的某些值,但浏览器未显示正确的结果。 The old result is appearing.
出现了旧结果。
var validationResult =validate("username");
var message = "Welcome, ";
if (validationResult) {
message += username;
$("#status").css("color", "green");
} else {
message += "Guest";
$("#status").css("color", "red");
}
In this example, first run on browser shows right result, but I changed the parameter of validate method as "invalidUser" but result did not changed. 在此示例中,首先在浏览器上运行会显示正确的结果,但是我将validate方法的参数更改为“ invalidUser”,但结果未更改。 I thing browser is caching values.
我的东西浏览器正在缓存值。 Should I clean browser history every run?
我是否应该每次运行都清除浏览器历史记录? Is there any clean solution for Internet Explorer or Firefox?
是否有针对Internet Explorer或Firefox的干净解决方案?
I think your browser is caching resources, not values. 我认为您的浏览器正在缓存资源,而不是值。 It could also be your server who is caching.
也可能是您的服务器正在缓存。
If you have the firebug plugin/extension in firefox you can disable page caching while developing on a per site basis. 如果您在firefox中具有firebug插件/扩展,则可以在基于每个站点进行开发时禁用页面缓存。
Just install firebug, open it, go to the net tab, click options (little arrow on the tab itself), select disable caches. 只需安装firebug,将其打开,转到“ net”选项卡,单击选项(选项卡本身的小箭头),然后选择“禁用缓存”。
You can force to clean the cache with this javascript 您可以使用此javascript强制清除缓存
window.location.reload(true);
with a falase argument will do the opposite 带有falase参数的情况将相反
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.