【发布时间】:2015-07-09 07:15:46
【问题描述】:
我知道我们可以在 Julius-code 中使用 Haskell 数据,例如:
$(function(){
$("section.#{sectionClass}").hide();
});
但是如何在 Haskell 代码中使用 JS 变量呢?例如:
... in some .julius
$(function set_global_variable( value ) {
window.myGlobalValue = value;
});
... in some handler, pseudocode:
getMyPageR :: Handler Html
getMyPageR = do
let globalValue = [julius|window.myGlobalValue;|]
...
有可能吗?
【问题讨论】:
标签: javascript yesod yesod-julius