add functions to create js-objs from hickory
This commit is contained in:
parent
5be6f866bc
commit
7c73735a64
1 changed files with 18 additions and 6 deletions
|
@ -67,12 +67,24 @@
|
|||
(.-classList)
|
||||
(.add "was-validated")))
|
||||
|
||||
(defn replace-element-content
|
||||
[name
|
||||
content]
|
||||
(-> (get-element-by-id name)
|
||||
(.-innerHTML)
|
||||
(set! (hr/hickory-to-html content))))
|
||||
(defn create-js-obj-from-html
|
||||
[html-string]
|
||||
(-> js/document
|
||||
.createRange
|
||||
(.createContextualFragment html-string)))
|
||||
|
||||
(defn append-to-body
|
||||
[js-obj]
|
||||
(-> js/document
|
||||
.-body
|
||||
(.appendChild js-obj)))
|
||||
|
||||
(defn append-hickory
|
||||
[hickory-obj]
|
||||
(-> hickory-obj
|
||||
(hr/hickory-to-html)
|
||||
(create-js-obj-from-html)
|
||||
(append-to-body)))
|
||||
|
||||
(defn generate-feedback-tag
|
||||
[id]
|
||||
|
|
Loading…
Reference in a new issue