English 中文(简体)
Display历经修改后显示
原标题:Display last modified time of JavaScript file
  • 时间:2011-09-30 17:30:25
  •  标签:
  • javascript

我正在开发一个网络应用程序,浏览器每当我复读时就总是把海滩空出,因此,有时我不会拿到我 Java文的最新版本。

我要发出一个短信,表明我是否每次复读时都使用最近版本的贾瓦文。 我认为,展示“最后修改”贾瓦文案卷的时间,将起到作用!

Any thoughts? Is there a standard solution to my problem that I ve missed?

最佳回答

在生产环境方面,如果你修改你的文字档案,你就可以改变你的文字标签,列入一个版本的插图,以便浏览器看到新的版本,并从服务器中获取新的版本:

<script type="text/javascript" src="/scripts/myscript.js?v1"></script>

This is just a simple trick that gives the browser a url it hasn t seen before, forcing it to request the new file. The server ignores the querystring and just returns the script file.

关于发展环境,新闻网站ctrl+f5迫使浏览器从服务器上翻一番。

问题回答

我对这种问题的标准解决办法(如果我确实正确理解你的关切),是检查火焰上的蚊帐。 前往Js分表,然后看看从服务器/邮局索取js文档清单。 仅检查答复负责人。

参看这里的其他答案。 浏览器使用Ctrl + f5来更新浏览器(如果你想要从炉子上复制新版)。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签