JavaScript Include
<!-- index.html --> <html> <body> <script src="/path/to/foo.js"></script> </body> </html>
// foo.js document.writeln('<div class="rssChannel">'); document.writeln(' <h3 class="rssTitle">'); document.writeln(' <a href="http://blog.excite.co.jp/shokotan">しょこたん☆ぶろぐ</a>'); document.writeln(' </h3>'); document.writeln(' <div class="rssItem">'); document.writeln(' <a href="http://blog.excite.co.jp/shokotan/2867294/">シャーベット色の時間</a><br />'); document.writeln(' <a href="http://blog.excite.co.jp/shokotan/2867292/">マッシュ</a><br />'); document.writeln(' <a href="http://blog.excite.co.jp/shokotan/2867290/">まいこ</a><br />'); document.writeln(' <a href="http://blog.excite.co.jp/shokotan/2867288/">からすみ</a><br />'); document.writeln(' <a href="http://blog.excite.co.jp/shokotan/2867286/">サークルディフェンサー</a><br />'); document.writeln(' <a href="http://blog.excite.co.jp/shokotan/2867284/">バイオ</a><br />'); document.writeln(' <a href="http://blog.excite.co.jp/shokotan/2867282/">かさ</a><br />'); document.writeln(' <a href="http://blog.excite.co.jp/shokotan/2867280/">セーヌ河</a><br />'); document.writeln(' <a href="http://blog.excite.co.jp/shokotan/2867278/">マーレ</a><br />'); document.writeln(' <a href="http://blog.excite.co.jp/shokotan/2867276/">かっち</a><br />'); document.writeln(' </div>'); document.writeln('</div>');
このようにすると,foo.js の内容がブラウザ上で実行され,その結果が index.html の foo.js をインクルードした場所に挿入される。