简体   繁体   中英

Changing dependency of WebSharper.JQueryUI to load jquery-ui.js locally

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>

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>

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.

I'm using (NuGet versions) WebSharper 3.0.54.140 and WebSharper.JQueryUI 3.0.45.241.

How do I force WebSharper to output a link to a resource local to the server?

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>

Edit: just fixed the documentation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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