1

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?

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! Just out of curiosity, what's with the plus in "...Dependencies+JQueryUIJs"?
It's the IL notation for nested types. Here Dependencies is an F# module, so from the point of view of the runtime JQueryUIJs and JQueryUICss are nested types. If you type typeof<WebSharper.JQueryUI.Dependencies.JQueryUIJs>.FullName;; in F# interactive, you will get the +.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.