Skip to content
Browse files

Went from a JSPtr to any JS Value. :)

  • Loading branch information...
1 parent b52b24d commit d477c9ffeed47d7c4f20a60a03d41a1593f6c948 @spockz spockz committed Jan 9, 2012
View
4 uhc-jscript/src/Language/UHC/JScript/JQuery/Ajax.hs
@@ -52,7 +52,7 @@ toJSOptions options = let url' = toJS (ao_url options)
}
-ajaxBackend :: JS r => (JSPtr a -> IO ()) -> AjaxOptions a -> JSPtr b -> AjaxCallback r -> AjaxCallback r -> IO ()
+ajaxBackend :: (JS r, JS v) => (JSPtr a -> IO ()) -> AjaxOptions a -> v -> AjaxCallback r -> AjaxCallback r -> IO ()
ajaxBackend cont options valdata onSuccess onFailure =
do let jsOptions = toJSOptions options
onSuccess' <- mkJSAjaxCallback onSuccess
@@ -64,7 +64,7 @@ ajaxBackend cont options valdata onSuccess onFailure =
_ <- setAttr "data" valdata o
_ajaxQ (toJS "jcu_app") o
-ajax :: JS r => AjaxOptions a -> JSPtr b -> AjaxCallback r -> AjaxCallback r -> IO ()
+ajax :: (JS r, JS v) => AjaxOptions a -> v -> AjaxCallback r -> AjaxCallback r -> IO ()
ajax = ajaxBackend _ajax
View
2 uhc-jscript/src/Language/UHC/JScript/JQuery/AjaxQueue.hs
@@ -8,7 +8,7 @@ import Language.UHC.JScript.JQuery.Ajax
import Language.UHC.JScript.Assorted (alert, _alert)
-ajaxQ :: JS r => String -> AjaxOptions a -> JSPtr b -> AjaxCallback r -> AjaxCallback r -> IO ()
+ajaxQ :: (JS r, JS v) => String -> AjaxOptions a -> v -> AjaxCallback r -> AjaxCallback r -> IO ()
ajaxQ queuename = ajaxBackend (_ajaxQ $ toJS queuename)
foreign import jscript "$.ajaxq(%*)"

0 comments on commit d477c9f

Please sign in to comment.
Something went wrong with that request. Please try again.