问题描述
我正在写一个使用JQueryUI扩展名的WebSharper网站. WebSharper网站小程序生成的HTML如下所示:
I'm writing on a WebSharper sitelet that uses the JQueryUI extension. The HTML generated by the WebSharper sitelet looks like this:
<html>
<head>
...
<script src="//code.jquery.com/ui/1.11.1/jquery-ui.js" ...></script>
在开发过程中,我经常没有互联网,因此我真的想在开发服务器之外提供jquery-ui.js
服务.也就是说,我宁愿拥有这个:
I'm frequently without internet while developing, so I'd really like to serve jquery-ui.js
off the development server instead. That is, I'd much rather have this:
<html>
<head>
...
<script src="/Scripts/jquery-ui.js" ...></script>
文档说,应该可以通过在Web.config
中设置适当的appSetting
,但我为文档中列出的键设置的值似乎对输出没有任何影响.
The docs say this should be possible by setting an appropriate appSetting
in Web.config
, but no value I set for the keys listed in the docs seem to have any effect on the output.
我正在使用(NuGet版本)WebSharper 3.0.54.140和WebSharper.JQueryUI 3.0.45.241.
I'm using (NuGet versions) WebSharper 3.0.54.140 and WebSharper.JQueryUI 3.0.45.241.
如何强制WebSharper将链接输出到服务器本地资源?
How do I force WebSharper to output a link to a resource local to the server?
推荐答案
事实上,文档中存在错误.使用的密钥是资源类型的标准名称,因此对于WebSharper.JQueryUI,它应为:
Indeed there is an error in the documentation. The key to use is the fully qualified name of the resource type, so for WebSharper.JQueryUI it should be:
<appSettings>
<add key="WebSharper.JQueryUI.Dependencies+JQueryUIJs" value="/Scripts/jquery-ui.js" />
<add key="WebSharper.JQueryUI.Dependencies+JQueryUICss" value="/Content/jquery-ui.css" />
</appSettings>
只需修复文档即可.
这篇关于更改WebSharper.JQueryUI的依赖项以在本地加载jquery-ui.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!