Hello all,
I got a small question wich got me stuck.
I got a HTML page with javascript which im using to retreive a list of authors of my wordpress blogwebsite:
HTML:
<div data-role="content" id="authorlist">
<!-- A list of all the authors of the wordpress page. -->
</div>
Using the following JSON script:
<script src="http://bloggingaboutoracleapplications.org?json=get_author_index&callback=listAuthors" type="text/javascript"></script>
Which uses the following javascript:
function listAuthors(data){ //Alle Authors ophalen
var output='<ul data-role="listview" data-filter="true">';
$.each (data.authors, function(key,val) {
var tempDiv =
document.createElement("tempDiv");
tempDiv.innerHTML = val.excerpt;
$("a",tempDiv).remove();
var excerpt = tempDiv.innerHTML;
output+='<li>';
output+='<a href="#postsFromAuthors" onclick="postsFromAuthors(' + val.id + ')" >';
output+='<h3>' + val.name + '</h3>';
output+='<p>' + val.description + '</p>';
output+='</a>';
output+='</li>';
}); //Go through each author
output+='</ul>';
$('#authorlist').html(output);
}
Which results in a nice looking author page:

The following step would be to click on a person in this list and retreive all the blog posts this person has writen.
As you could see, i call the following function for this: #postsFromAuthors"
Which uses the following Javascript:
function postsFromAuthors(id){ //Alle posts ophalen van de geselecteerd author
var output='<ul data-role="listview" data-filter="true">';
$.getJSON('http://bloggingaboutoracleapplications.org/?json=get_author_posts&id=' + id + '&callback=?',
function (data) {
$.each(data.posts,function(key,val) {
var tempDiv = document.createElement("tempDiv");
tempDiv.innerHTML = val.excerpt;
$("a",tempDiv).remove();
var excerpt = tempDiv.innerHTML;
output+='<li>';
output+='<a href="#blogpost" onclick="showPost(' + val.id + ')">';
output+='<h3>' + val.title + '</h3>';
output+='<p>' + excerpt + '</p>';
output+='</a>';
output+='</li>';
output+='</ul>';
$('#listFromAuthor').html(output);
}); //Go through each post
});
}
And the corresponding HTML:
<div data-role="content" id="listFromAuthor">
Attempting to load the blogposts of the selected author, please wait...<br><br> If this does not happen, please try reloading the page.
</div> <!-- Hier komen de author posts door het script onderaan de pagina. -->
However, here comes the problem... Instead of giving me a nice list just like the first screenshot, it is giving me a list like this:

Can anybody tell me what im doing wrong?
Thank in advance...
Zylox