As I work on creating a mobile website using Cordova, I've come across an interesting javascript framework called nativedroid2. This framework offers ready-made html classes and effects that can be applied to the code.
Currently, my goal is to dynamically generate HTML code in jQuery by making AJAX calls to a server instead of burdening the server with handling the task. However, when trying to use the html()
function on certain div elements to load HTML content, I noticed that the styling from nativedroid's javascript functions was not being applied. As a result, the appearance did not reflect the usage of nativedroid2. While I have yet to implement AJAX calls for this purpose, I wanted to ensure that html()
would work properly with nativedroid.
var html1;
var html2;
function loadpage(id, data) {
generateContent(id, data);
$('[data-role="header"]').html(html1);
$('[role="main"]').html(html2);
}
function generateContent(id, data) {
html1 = "bunch of html for the header"
html2 = "bunch of html for the body"
If anyone has suggestions for a better alternative to html()
, or know of a fix to resolve this issue, I would greatly appreciate any insights and advice.