Skip to content

Commit

Permalink
examples: add wordpress blog posts list example
Browse files Browse the repository at this point in the history
  • Loading branch information
retrofox committed Feb 11, 2016
1 parent d1edb1f commit 4ce60f9
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions examples/browser/blog.wordpress.com.html
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<title>WordPress.com Blog - Posts list</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<script src="../../dist/wpcom-xhr-request.js"></script>
<script>
var req = WPCOM.xhr( {
path: '/sites/en.blog.wordpress.com/posts'
}, function( err, res ) {
if ( err ) throw err;

console.log(res);

var d = document.createElement( 'pre' );
d.innerHTML = JSON.stringify( res, null, 2 );
document.body.appendChild( d );
} );
</script>
</body>
</html>

0 comments on commit 4ce60f9

Please sign in to comment.