So I have a sample page that works to replicate table layout pages without using the very mobile-unfriendly table features.
Basically I have a page that looks like so:
<html>
...
<body>
<div type="page">
<div class="header">
</div> <!-- /header -->
<div class="body">
<script type="text/javascript">
$(document).ready(function() {
$(".header").load("/common/header.html");
$(".body").load("/Example/example-home.html");
//Call to superclass function to replace contents after load
});
/*$(document).ready(function() {
$.ajax({
url: "/Example/example-home.html",
}).done(function (data) {
$(".body").append(data);
});
});*/
</script> -->
</div> <!-- /body -->
</div class="footer">
</div> <!-- /footer -->
</div> <!-- /page -->
</body>
</html>
The file that is being called via ajax looks like:
<style>
/* Various CSS Stylings */
</style>
<script type="text/javascript">
/*Populate our scripts upon ajax request
var sList[0] = ["Color Mutate", "Versatile, Schemebale, string mutation script. Format your text in any color scheme you can dream.", "1.2.0"];
$(document).ready(function() {
if (!sList) {
$(".table").html("<p>No hosted scripts found</p>");
} else {
for (var i = 0;i<=sList.length;i++) {
$(".script").append(sList[i][0]);
$(".desc").append(sList[i][1]);
$(".version").append(sList[i][2]);
}
}
}); */
// moved to main.js
</script>
<div class="table">
<div class="script">
</div>
<div class="desc">
</div>
<div class="version">
</div>
</div> <!-- /table -->
And the ajax call is successful when viewed in firebug, the resulting output looks identical to the example-home.html file, but the browser shows nothing in the <div class="body"></div> section afterwards.
I fear it's an issue with the asynchronous nature of ajax calls, but cannot seem to figure out a viable solution.
EDIT I have also tried doing $(this).append() instead of the $(".body").append() as shown above to no avail as well.
EDIT 2 Updated to working code
$(".body").load("/Example/example-home.html");