Пример кода – небольшой «библиотеки»:
File - json.js
var g_books = [
 {
id: 1,
name: 'Code Generation in Action',
first: 'Jack',
last: 'Herrington',
publisher: 'Manning'
}, {
id: 2,
name: 'PHP Hacks',
first: 'Jack',
last: 'Herrington',
publisher: 'O\\'Reilly'
}, {
id: 3,
name: 'Podcasting Hacks',
first: 'Jack',
last: 'Herrington',
publisher: 'O\\'Reilly'
}
];
<font color="#990000">HTML : <strong>book.html</strong></font>
<html>
<head>
<title>Simple JS loader</title>
<script src="json.js" mce_src="json.js"></script>
</head>
<body>
<script>
document.write( "Found "+g_books.length+" books" );
</script>
</body>
</html>
