(These meta placeholders are/were documented on the old HTML templating page, and indeed should be carried into the new docs.)

By on 1/8/2018 5:07 AM ()

And just to quote it here:

Special holes in server-side templates

In a server-side template, you must specify the location of where WebSharper can include its generated content. Three special placeholders are provided to include client-side content in the page: scripts is replaced with the JavaScript files required by the client-side code included in the page (including WebSharper-generated .js files). Usage: <script ws-replace="scripts"></script> styles is replaced with the CSS files required by the client-side code included in the page. Usage: <script ws-replace="scripts"></script> * meta is replaced with a <meta> tag that contains initialization data for client-side controls. Usage: <meta ws-replace="meta" />

The scripts hole is necessary for correct working of the served page if it contains any client-side WebSharper functionality. The other two are optional: if neither styles nor meta is provided explicilty, then they are included automatically above the content for scripts.

By on 1/8/2018 5:37 PM ()

Added this to https://developers.websharper.com/docs/v4.1/fs/ui under "Special holes in server-side templates"

By on 1/8/2018 7:15 AM ()

Hi, thanks for the suggestion, we should indeed include it in the documentation.

<script ws-replace="scripts"></script> is where the script links for WS-generated js files are included in the server response. Client-side controls are initialized only after document load, so this can be anywhere, but must not be omitted.

There are 2 more: <meta ws-replace="meta"> and <style ws-replace="style"></style>. These specify the positions for client-side control data (any serialized arguments) and script links needed as explored by WebSharper's resource tracking. But these are both automatically included right next to the scripts if no separate placeholder for them is specified.

By on 1/8/2018 4:34 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us
Built with WebSharper