I'm working inside Fat-Free-Framework, using the F3 Template Language, but I've come across an issue I'm not sure how to solve.
I've got a portion of a webpage, which contains data from a database that needs to be updated at some interval to make sure the person looking at the page is looking at up-to-date information.
I can easily load the data this way:
<div id="container">
<include href="module/views/table_pending.htm"/>
</div>
This works, but it doesn't update at an interval. I know I need to use jQuery for this, so I tried to use the load()
method to load this page fraction, but it isn't rendering properly.
This is my Javascript
function loadPageContents() {
$('#container').load('{{@BASE}}/app/modules/module/views/table_pending.htm');
}
loadPageContents();
Here is a minimal version of my table_pending.htm
:
<repeat group="{{ @data }}" value="{{ @device }}">
{{ @device[uid] }}<br>
</repeat>
When using F3's include
element, my page renders as expected:
But when using jQuery .load()
, it seems that F3's template language isn't really parsed at all (thus variables not being replaced, loop not working properly etc):
So my question is, how can I include this page fragment into my main page, update it on an interval, and still render my template language?