gpt4 book ai didi

javascript - 谷歌在请求外部文件的离线/本地主机应用程序中美化

转载 作者:行者123 更新时间:2023-11-29 14:55:14 24 4
gpt4 key购买 nike

google prettify 对我来说效果很好。我已经构建了一个带有 Twitter Bootstrap 前端和谷歌美化语法突出显示的应用程序。但该应用程序也可用于离线工作,例如本地主机,所以我包含了 prettify.js 和 prettify.css。

现在当我离线并在应用程序中工作时,它会开始通过本地 prettify.js 版本寻找在线代码:

  • https://google-code-prettify.googlecode.com/svn/loader/lang-"+encodeURIComponent(D[m])+".js

  • https://google-code-prettify.googlecode.com/svn/loader/skins/"+encodeURIComponent(N[m])+".css

  • https://google-code-prettify.googlecode.com/svn/loader/prettify.css

它离线工作正常,但为什么它请求外部 js 和 css 文件,我如何从缩小的 prettify.js 中删除它?我不需要它,它会减慢应用程序的速度。

最佳答案

GettingStarted维基页面解释:

Serving your own JS & CSS

You can download the scripts and styles and serve them yourself. Make sure to include both the script and a stylesheet:

<link href="prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="prettify.js"></script>

关于javascript - 谷歌在请求外部文件的离线/本地主机应用程序中美化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18956597/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com