问题标签 [include]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
5 回答
9183 浏览

html - 将 .asp 文件包含到 html 文件中

除了必须用 asp 处理所有 html 文件之外,如何在 html 文件中包含 .asp 文件并对其进行处理。

0 投票
5 回答
1060 浏览

html - 如何在 Windows Web 服务器上动态更新纯 html 文件中的变量

我们在网站上有一些旧的 html 文件,页面底部有版权年份(来自包含文件)。我们正在尝试找到一种将其动态更新到当前年份的方法,因此不需要每年都编辑包含文件。我们在同一台服务器上使用 asp 和 .net,因此可能有办法使用这些技术来实现这一点。

我正在考虑几种可能实现这一目标的方法,但我确信我错过了一些东西。也许可以完成某种令牌替换或其他事情。

以下是我正在考虑的几个选项。

  1. 服务器上的一个进程,它将每天检查一次年份更改并重写包含文件,或者每年由计划任务触发一次。

  2. 一个 Web 应用程序,在访问时会检查当前年份并将其写入包含文件。它需要写入磁盘的权限。然后使用 wget 之类的东西访问它,每年一次的计划任务或在时间到时手动访问它。

  3. 将 javascript 作为非 asp 包含文件的一部分嵌入,这些文件将在页面完成加载之前动态更新年份。这是实现这一目标的最简单方法之一,但可能不是最好的。

  4. 找到一种在嵌入文件之前处理文件的方法。

  5. 对 html 文件启用 asp 处理。这是不可取的,因为它可能会导致服务器负载。

0 投票
6 回答
2038 浏览

c++ - A的缺点引入所有标准头文件的文件?

我发现长序列的标准包括烦人:

考虑到这些头文件很少更改,是否有理由不制作“std.h”文件#包括所有std头文件并在任何地方使用它?

0 投票
4 回答
2714 浏览

python - AppEngine 和 Django:包括一个模板文件

正如标题所示,我使用的是 Google App Engine 和 Django。

我的模板中有很多相同的代码,并希望通过包含模板文件来减少这种情况。因此,在我的主应用程序目录中,我有 python 处理程序文件、主模板和我想要包含在主模板中的模板。

我原以为包括 {% include "fileToInclude.html" %} 会单独工作,但这根本不包括任何东西。我假设我必须设置一些东西,也许使用 TEMPLATE_DIRS,但我自己无法弄清楚。

编辑:

我试过了:

但无济于事。我也会尝试一些其他的可能性。

0 投票
1 回答
1613 浏览

c# - QueryObject Include Entity Framework

I have three tables: Scenarios, Components and Blocks. Blocks has a foreign key to ComponentId and Components has a foreign key to Scenarios.

Blocks also has a foreign key (TreeStructureId) to another table TreeStructures.

Now, why does this work:

It loads the TreeStructures, Components and Scenarios.

This however doesn't work:

This loads the Components and Scenarios but doesn't load the TreeStructures...

Seems very strange to me... Why is this?

thx, Lieven Cardoen

0 投票
6 回答
34152 浏览

visual-studio - 我可以在 exe 中包含 dll(在 Visual Studio 中)吗?

可能重复:
.NET windows 应用程序,可以将其压缩为单个 .exe 吗?

要运行我需要的位于 Debug and Release 文件夹中的应用AxInterop.WMPLib.dll程序Interop.WMPLib.dll。有没有办法将这些 dll 包含到 exe 中,这样我的应用程序只能在一个文件中使用?

0 投票
6 回答
14210 浏览

asp-classic - 是否可以在 asp-classic 中发布动态包含?

我的意思是,像 php'h 包括...

就像是

就我目前所见,有几种选择,但每一种都有一些缺点......

我想弄清楚的是如何制作一个灵活的模板系统......而不必将整个东西静态地包含在一个带有loooooong case语句的文件中......

这里有几个链接

使用 FileSysmemObject 的解决方案,只允许您包含静态页面

同上

还有一个

adobe 中的相同内容

这种方法使用 Server.Execute

但它有一些我想避免的缺点......似乎(还没有尝试过)Server.Execute 代码在另一个上下文中运行,所以你不能用它来加载你计划在来电代码...讨厌...

一样

我觉得这个是一样的

这看起来很有希望!

我不确定(还不能测试它),但似乎这个 dinamycally 将页面处理到一个 SSDI 组件......

任何想法???

0 投票
2 回答
233 浏览

c++ - Include indirection on Visual C++

Let's say we have an application that will need Boost to compile. Boost being an external library, updated regularly, and our application having multiple binaries and multiple versions ("multiple" as in "Let them grow and multiply"... don't ask...), we need an easy to update/maintain indirection to have for each app's version link with the right Boost version.

For example:

  • MyApp 8.0 => Boost 1.34
  • MyApp 8.1 => Boost 1.35
  • MyApp 9.0 => Boost 1.35
  • MyApp 10.0 => Boost 1.37

On a Linux filesystem, we would create a symbolic link redirecting to the right boost directory:

  • MyApp 8.0 => MyAppBoostLink_8.0 => Boost 1.34
  • MyApp 8.1 => MyAppBoostLink_8.1 => Boost 1.35
  • MyApp 9.0 => MyAppBoostLink_9.0 => Boost 1.35
  • MyApp 10.0 => MyAppBoostLink_10.0 => Boost 1.37

This would enable us to easily update MyApp 10.0 to link with Boost 1.38 when it will be available, just by replacing the symbolic link.

But on Windows, this does not work (or I missed something).

Boost itself seems to give up on the idea: With BJam, I recall seeing warnings saying BJam was copying the lib files because symbolic links did not work on WinNT. I tried an alternative, as we use Visual C++, but no pragma resolves this problem (I searched for a pragma adding default search directories for header includes and library links, but found none).

I can't believe I'll need to launch a script to check-out the VCPROJs files (Visual C++ XML makefiles), to update the Boost includes, and then check-in the modifications, but I see no other solution until Windows have working symbolic links (or either I discover how to create them).

Is there a better idea?

Edit

The problem disappeared when we updated our compiler, from Visual C++ 2003 to Visual C++ 2008. Apparently, Visual C++ 2008 sees symbolic links across networks.

0 投票
2 回答
6985 浏览

c++ - 在 makefile 中描述头文件位置

在我正在研究的一个新项目中,我有以下目录结构:

在我的源文件中,我包含如下所示:

而不是更正确的形式:

我需要在我的 makefile 中添加什么,以便我可以删除包含的相对路径,以便它们看起来正常?


补充:另外,我在 CDT(Eclipse 的 C++)中在哪里设置它,以便在设计时也能反映出来?

0 投票
3 回答
1414 浏览

php - 包括 file_exists 安全性

这有多安全?例如,如果页面位于名为 pages 的文件夹中,您能否在另一个 Web 服务器上包含该页面?

谢谢