I'm trying to implement this nav bar on my Yesod web app. My question how should I call a hamlet file from the javascript?
.....
.....
var Tabs = {
'Tab one' : 'pages/page1.html',
'Tab two' : 'pages/page2.html',
'Tab three' : 'pages/page3.html',
'Tab four' : 'pages/page4.html'
}
.....
.....
As you can see it's calling the html pages with relative pathing, how do I do something like $(widgetFile "mypage")?or @{MyPageControllerR}?
I suggest to you write as html
<ul>
<li>
<a href="@{...}" ...
You can write as javascript using julius, in that case some like
var Tabs = {
'Tab one' : '@{MyPageController1R}',
'Tab two' : '@{MyPageController2R}',
'Tab three' : '@{MyPageController3R}',
'Tab four' : '@{MyPageController4R}'
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With