0

I am creating a site that uses Java Script and CSS from jQuery and jQuery Mobile. Right now I am not hosting any of the files but rather referencing URLs on the jQuery site. This has the disadvantage that I have to load resources from jQuery every time the page loads and I cannot alter the files myself. I want to switch to hosting this stuff locally and would like to go about it in an organized and scalalable fashion. Is there any better way to do this than just copying the code from the links and pasting it into my own local .css and .js files?

4

1 回答 1

0

修改 jQuery 源代码并不理想,因为您需要在每个新版本中维护它。如果您想添加其他功能,最好创建 jQuery 插件。至于管理你的项目的 CSS 和 JavaScript 文件,大多数 IDE 会按照 JavaScript 和 CSS 文件放置在一个scriptsstyles目录,分别在您的项目根目录下。除此之外,明智的做法是使用某种形式的源代码控制(例如 git)对您的更改进行分类。网上有很多关于如何使用这个工具的文档,并且解释如何使用任何形式的源代码管理对于 StackOverflow 上的答案来说太宽泛了。但是,您必须保持一定程度的心理纪律,尤其是当您手动管理 Web 项目的结构时。这将随着时间和经验来确定最适合您的方法。

于 2013-01-24T19:22:01.293 回答