1

ページにカスタム backbone.js スクリプトを追加していますが、ページの最後に配置する必要があります。

ここで説明されているように、HTML ヘッドにスクリプトを追加するためのソリューションを見てきました:テンプレートをエンライブ – ヘッド セクションに追加

残念ながら、ページの下部にスクリプトを追加する必要があります。

<html>
   <head><!-- all the normal css and js scripts--></head> 
   <body> 
      <div> <!-- html content that will be used by my scripts --> </div>
      <!-- this is where i want to append custom javascripts  -->

  </body>

</html>
4

1 に答える 1

1

conj と同じくらい簡単であることに気付きました。[:body] トランスフォーマーへの入力がベクトルであることがわかったら、conj は明らかな解決策になりました。

(html/sniptest "<html><body><header class=\"some_class\">Header Content</header><footer>sddsd</footer></body></html>"
    [:body] (fn [html-source]
              (let [conts (:content html-source)
                    newstuff  {:tag :script
                               :attrs {:src "../javascripts/foundation/foundation2.forms.js"}
                               :content []}
                    _  (pprint conts)
                    _  (print (class  conts))
                    conts2 (conj conts newstuff )]
                (assoc html-source :content conts2))))
于 2014-05-25T15:10:49.167 に答える