How to integrate news into web application?
To integrate news into your application, copy-paste following HTML snippet into your application's page:
<div id="news">
<script type="text/javascript"
src="http://your.news.server/newsinjector/includeNews.js">
</script>
</div>
NOTE: The HTML page must be served from a web server. If you try to include news into a static HTML file loaded directly from a file system, your web browser will restrict execution of JavaScript and no news will be visible.
If you copy-pase the snippet above, you need to adjust "your.news.server" to a real server name. However, NewsInjector application provides a page "Integration" where environment-dependent HTML snippet is generated for you so you don't need any adjustments.
The HTML snippet above loads a JavaScript file from a NewsInjector server. The loaded JavaScript is executed and it writes all published news directly into your page.
As a result, you get the following HTML structure included into your application's page.
<div id="news">
<div>
<div class="date">08/07/2007</div>
<div class="title">News 1 Title</div>
<div class="content">News 1 content.</div>
</div>
<div>
<div class="date">07/07/2007</div>
<div class="title">News 2 Title</div>
<div class="content">News 2 content.</div>
</div>
...
<div>
<div class="date">01/07/2007</div>
<div class="title">News N Title</div>
<div class="content">News N content.</div>
</div>
</div>
If it doesn't look like a nice HTML piece, don't worry, NewsInjector application ("Integration" page) provides CSS to layout your news nicely.
Have a look at the NewsInjector Tour to see installation and integration of NewsInjector in action.