Permalink
Browse files

Add encodeURIComponent

  • Loading branch information...
1 parent fb65469 commit b1a74e69ad7001dd7657a0df90e32a3de9597cd2 @norm2782 norm2782 committed Apr 1, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 uhc-js/src/Language/UHC/JScript/W3C/HTML5.hs
@@ -53,6 +53,7 @@ module Language.UHC.JScript.W3C.HTML5
, nodeListLength
, pathName
+ , encodeURIComponent
)
where
@@ -217,3 +218,9 @@ foreign import js "window.location.pathname"
pathName :: IO String
pathName = fmap fromJS _pathName
+
+encodeURIComponent :: String -> String
+encodeURIComponent = (fromJS :: JSString -> String) . _encodeURIComponent . (toJS :: String -> JSString)
+
+foreign import js "encodeURIComponent(%1)"
+ _encodeURIComponent :: JSString -> JSString

0 comments on commit b1a74e6

Please sign in to comment.