javascript 什么是 jstcache 以及为什么将它添加到我的 HTML 标签中?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31128390/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-28 13:20:07  来源:igfitidea点击:

What is jstcache and why it is being added to my HTML tags?

javascripthtml

提问by Hyman

While using Firebug, I have noticed an attribute name jstcacheis added to some of my html tags, while it is not visible in the source of the page. In Firebug I see following

在使用 Firebug 时,我注意到一个属性名称jstcache被添加到我的一些 html 标签中,而它在页面的源代码中是不可见的。在 Firebug 中,我看到以下内容

<html lang="en" jstcache="0">
  <head>
  <body jstcache="0">
  <div class="mydiv" jstcache="0">
    ....

I google result shows it is related to JSTemplate, I am not using it and I do not know why it is being added to my code?

我谷歌结果显示它与JSTemplate相关,我没有使用它,我不知道为什么它被添加到我的代码中?

回答by cst1992

It seems it's jsTemplate:

它似乎是 jsTemplate:

https://code.google.com/p/google-jstemplate/wiki/HowToUseJsTemplate

https://code.google.com/p/google-jstemplate/wiki/HowToUseJsTemplate

All the tags are of the style jstXXX.

所有标签的样式都是 jstXXX。

jstcache=0 is just saying 'don't store this page in the browser's cache'.

jstcache=0 只是说“不要将此页面存储在浏览器的缓存中”。

回答by dgrundel

These attributes are added by Javascript after the page loads, so you won't see them in the source tab.

这些属性是在页面加载后由 Javascript 添加的,因此您不会在源选项卡中看到它们。

It is very likely that this is due to some Firefox extension you have installed.

这很可能是由于您安装了某些 Firefox 扩展。

回答by Atul Sharma

jstcache is automatically added when js-template is used.

使用 js-template 时会自动添加 jstcache。

Now what is js-template ?

现在什么是 js-template ?

js-template is a powerful browser-side templating framework for jQuery + HTML5. It is an updated and modernized reincarnation of Google's excellent open-source JsTemplate project.

js-template 是一个强大的浏览器端模板框架,适用于 jQuery + HTML5。它是 Google 优秀的开源 JsTemplate 项目的更新和现代化改造。

You can find more here

你可以在这里找到更多

https://github.com/toddfast/js-template

https://github.com/toddfast/js-template

回答by TheRealLolDude 2002

JavaScript templating (js template) is a fast and efficient technique to render client-side templates with JavaScript using a JSON data source. The template is HTML markup, peppered with tags that will either insert variables or run programming logic.;]

JavaScript 模板(js 模板)是一种使用 JSON 数据源通过 JavaScript 呈现客户端模板的快速有效的技术。模板是 HTML 标记,带有插入变量或运行编程逻辑的标签。;]

回答by JNinja22

This occurs because the script tags while loading through the httppipeline are exposed to spideyprotocol filters and this is added to ensure that it is executed with appropriate protocol so that it remains accessible

发生这种情况是因为通过http管道加载时的脚本标签暴露给了蜘蛛网协议过滤器,并且添加了这一点是为了确保它使用适当的协议执行,以便它保持可访问性