You need to add a reference to the WebSharper.Html NuGet package in your project to resolve 1) and 2). But that example is from ages ago (years old) and you will need to adapt it to the project template you are using. The quickest way would be:

1) Start with a new SPA project (WebSharper Single-Page Application) 2) Add the WebSharper.Html NuGet to the project as indicated above 3) Open index.html and add a placeholder node to the body (and remove the rest of the template as needed):

1
2
3
```xml
<div id="Content"></div>
```

4) Open Client.fs and replace it with the sample, but without the CanvasViewer type. 5) Annotate your SPA entry point in Client.fs:

1
2
3
4
```fsharp
[<SPAEntryPoint>]
let Main () = ...
```

6) And last, trigger injecting the computed content to the new placeholder node by adding this line to the bottom of the Main function:

1
2
3
```fsharp
    |> fun s -> s.AppendTo "Content"
```

Hope this helps.

By on 10/22/2017 8:32 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper