Yes thanks I have actually rectified the problem by doing something similar.
Code:
function writeContent(times) {
xhtml_code = '';
picker_ids = new Array();
counter = 0;
for (j = 0; j < times; j++) {
counter++;
picker_ids[j] = counter;
xhtml_code += '<div class="board" id="board-' + counter + '">'
+ '<span id="game_type">'
+ '<div class="loading"><img src="/img/loading.gif" style="border:0px;"> <em>Loading</em></div>';
xhtml_code += '</div></div></div></div>';
}
// write the code to the page and call the ajax function to load the contents
$(xhtml_code).appendTo('#div-container');
loadContent(picker_ids);
}
Code:
function loadContent(picker_ids) {
for (i = 0; i < picker_ids.length; i++) {
$('#board-' + picker_ids[i]).load('/page.php?counter=' + picker_ids[i]);
}
}
Bookmarks