web - The ability to create Doc element of hypertext in Websharper.UI.Next -


i have string html markup, want cretae doc elment this:

doc.fromhtm "<div><p>.....</p>.....</div>" 

as understand not possible right now. ok, not possible accurately sew, tried nail using jquery:

jquery.jquery.of( "." + class'name ).first().html(html'content) 

but call code, need specify event handler doc element. not implemented in ui.next. tried track changes of model given css class asynchronously:

let inbox'post'after'render = mailboxprocessor.start(fun agent ->          let rec loop (ids'contents : map<int,string>) : async<unit> = async {             // try recive event new portion of data             let! new'ids'contents = agent.tryreceive 100             // calculate state of agent             let ids'contents =                  // merge map's                 (   match new'ids'contents                     | none -> ids'contents                     | (new'ids'contents) ->                          new'ids'contents @ (map.tolist ids'contents)                         |> map.oflist )                                     |> map.filter( fun id content ->                     // calculate css class name                     let class'name = post'text'view'class'name id                     // change it's contents of html                     jquery.jquery.of( "." + class'name ).first().html(content).size() = 0)             // accept state of agent             return! loop ids'contents }         loop map.empty )          

and then, example 1 element:

inbox'post'after'render.post [id, content] 

but difficult, unreliable , not working. please give me idea how solve problem if possible. in advance!

just in case needs use static html in websharper on server (i needed add javascript websharper generated html page), there new doc.verbatim usable e.g. like

let main ctx action title body =     content.page(         maintemplate.doc(             title = title,             menubar = menubar ctx action,             body = body,             my_scripts = [ doc.verbatim javascript.content ]         )     ) 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -