简体   繁体   English

如果库没有 CDN,如何在不下载的情况下包含 JS 库?

[英]How do I include a JS library without downloading it, if library do not have a CDN?

I am trying to write a web scraping code that does not need any prior setup.我正在尝试编写一个不需要任何事先设置的网络抓取代码。

When I send the code to someone, I want him to be able to copy paste the code and use it right away, without having to manually download any libraries etc.当我将代码发送给某人时,我希望他能够复制粘贴代码并立即使用,而无需手动下载任何库等。

For jquery and bootstrap, I achieve this by simply using CDN's.对于 jquery 和 bootstrap,我通过简单地使用 CDN 来实现这一点。 But I couldn't find any CDN's for jsoup or htmlunit.但是我找不到任何用于 jsoup 或 htmlunit 的 CDN。

Can I somehow make my code include those libraries automatically, without depending on a directory of the computer it is run on?我可以以某种方式让我的代码自动包含这些库,而不依赖于运行它的计算机的目录吗?

jquery and bootstrap are javascript libraries, primarily used for building web pages and such. jquery 和 bootstrap 是 javascript 库,主要用于构建网页等。

jsoup and htmlunit are java libraries, these can be used to build standalone applications. jsoup 和 htmlunit 是 java 库,它们可用于构建独立的应用程序。

You are asking about two completely different things here.你在这里问的是两件完全不同的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM