diff --git a/Language/Elm/Yesod.hs b/Language/Elm/Yesod.hs
--- a/Language/Elm/Yesod.hs
+++ b/Language/Elm/Yesod.hs
@@ -1,17 +1,20 @@
 {-# LANGUAGE QuasiQuotes, TypeSynonymInstances #-}
 {-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, TypeFamilies #-}
 {- | This module provides a function for compiling Elm source code into a Yesod widget.
-     In order to use this with your Yesod app, you need to define a defaultLayout like
-     function that embeds the elm-min.js file /in the <head> tag/.
 
-     For example, you could modify your Yesod instance as follows:
+     You  need to define an instance of 'YesodElm', which will specify
+     where to find the elm-min.js file.
 
-   > instance Yesod App where
-   >    jsLoader _ = BottomOfHeadBlocking -- moves JS to the <head> tag
+     For example:
 
-     You also need to define an instance of 'YesodElm', which will specify
-     where to find the elm-min.js file.
+   > instance YesodElm App where
+   >   urlElmJs _ = Right $ "http://link.to/elm-min.js"
 
+     or
+
+   > instance YesodElm App where
+   >   urlElmJs _ = Left $ StaticR js_elm_min_js
+
      A full example implementation is provided in the examples folder of the Elm github repository
      at <https://github.com/tazjin/Elm/tree/master/Examples/elm-yesod>.
 -}
@@ -23,7 +26,7 @@
 import Control.Monad (liftM)
 import Text.Blaze (preEscapedToMarkup)
 import Text.Julius
-import Yesod.Core (Route (..))
+import Yesod.Core (Route (..), Yesod(..), ScriptLoadPosition(..))
 import Yesod.Handler (getUrlRenderParams, GHandler (..))
 import Yesod.Widget
 import Yesod.Handler (lift, getYesod)
@@ -38,30 +41,36 @@
     -- route (@Left@) or a raw string (@Right@).
     urlElmJs :: a -> Either (Route master) TS.Text
 
-instance (YesodElm master, render ~ RenderFn (Route master))
+instance (Yesod master, YesodElm master, render ~ RenderFn (Route master))
   => ToWidget sub master (render -> Elm) where
     toWidget = elmWidget
 
 -- |elmWidget returns a Yesod widget from some Elm source code
 --  with URL interpolation.
-elmWidget :: YesodElm master
+elmWidget :: (Yesod master, YesodElm master)
           => ElmUrl (Route master) -- ^ Elm source code
           -> GWidget sub master()
 elmWidget source = do
   urlF <- lift getUrlRenderParams
-  mkElmWidget source urlF
   master <- lift getYesod
+  mkElmWidget source urlF (jsLoader master)
   addScriptEither $ urlElmJs master
 
 
-mkElmWidget :: ElmUrl (Route master)   -- ^ Elm source code
+mkElmWidget :: Yesod master
+            => ElmUrl (Route master)   -- ^ Elm source code
             -> RenderFn (Route master) -- ^ URL rendering function
+            -> ScriptLoadPosition master
             -> GWidget sub master ()
-mkElmWidget source urlFn =
-  let (html, css, js) = toParts (urlFn, source) in
-  do toWidgetHead css
-     toWidgetHead [julius| #{js} |]
-     toWidgetBody html
+mkElmWidget source urlFn jsl =
+  let (html, css, js) = toParts (urlFn, source)
+      initscript = [julius| Dispatcher.initialize(); |]
+  in do toWidgetHead css
+        toWidget [julius| #{js} |]
+        toWidget html
+        case jsl of
+          BottomOfBody -> toWidget initscript  -- insert as last script
+          otherwise -> toWidgetBody initscript -- insert in body instead of head
 
 
 -- | Return type of template-reading functions.
diff --git a/elm-yesod.cabal b/elm-yesod.cabal
--- a/elm-yesod.cabal
+++ b/elm-yesod.cabal
@@ -1,5 +1,5 @@
 Name:                elm-yesod
-Version:             0.1.2
+Version:             0.1.3
 Synopsis:            The Elm language Yesod compatibility module.
 Description:         This module provides a simple function to embed Elm code
                      as a Yesod widget.
@@ -28,7 +28,7 @@
   exposed-modules:     Language.Elm.Yesod
   Build-depends:       base >=4.2 && <5,
                        blaze-markup == 0.5.*,
-                       Elm == 0.1.2.*,
+                       Elm >= 0.1.2.1,
                        yesod-core >= 1,
                        shakespeare-js,
                        text
