Skip to content

Commit

Permalink
moved divs to html5 tags
Browse files Browse the repository at this point in the history
  • Loading branch information
CirKu17 committed Jul 5, 2011
1 parent 04a5320 commit 0d2ccf3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 19 deletions.
24 changes: 7 additions & 17 deletions js/b4t.js
@@ -1,30 +1,20 @@
function nl2br(str) { return str.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '<br>'); }

$('<div id="page-wrap"></div>').html('# thoughts <br><br>');


$(document).ready(function(){
$.ajax({
type: "GET",
url: "post_db.xml",
dataType: "xml",
success: function(xml) {
$(xml).find('post').each(function(i){
success: function(xml) {
$(xml).find('post').each(
function(i){
var ts = $(this).attr('id');
var title = $(this).find('title').text();
var content = nl2br( $(this).find('content').text() );
$('<div class="items" ></div>').html('<br><b>timestamp: </b>'+ts+'<br><b>title: </b>'+title+'<br><b>content:</b>'+content+'<br><hr>').appendTo('#page-wrap');
});
$('<section></section>').html('<br><b>timestamp: </b>'+ts+'<br><b>title: </b>'+title+'<br><section><b>content:</b>'+content+'</section><br><hr>').appendTo('#page-wrap');
}
);
}
});
});


xmlDoc=loadXMLDoc("post_db.xml");

x=xmlDoc.getElementsByTagName('title');
for (i=0;i<x.length;i++)
{
document.write(x[i].childNodes[0].nodeValue);
document.write("<br>");
}

6 changes: 4 additions & 2 deletions thoughts.html
Expand Up @@ -7,12 +7,14 @@
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/js/loadxmldoc.js"></script>
<script type="text/javascript" src="/js/b4t.js" > </script>

</head>
<body>

<div id="page-wrap">
# thoughts <br><br>
</div>

<article id="page-wrap">
</article>

</body>
</html>
Expand Down

0 comments on commit 0d2ccf3

Please sign in to comment.