im working at the moment with jQuery Mobile. Whats the best way to split the Javascript and the HTML Files? Its possible to create single Views, and load them with Ajax into the code?
Example:
view.html
<li>
<img src="{$image}" alt="{$title}" /> {$title}
</li>
Javascript Code:
for(var i = 0; i < data.channels.length; i++)
{
var url = data.channels[i].url,
image = data.channels[i].image,
title = data.channels[i].name;
// load view.html and replace variables in each loop, than append view into an div
}
It could be also an MVC Framework that is working well with jQuery Mobile. Thank you!