I am trying to make a news preview from a separate file (text.html) I want to be able to just display the first 100 characters of a div (id="news"). I don't want to use Ajax or Php. Here is my code, not sure how to make it work, thanks guys.
<body onload="home()">
<div id="content"></div>
<script>
function home() {
var x = document.getElementById("content").innerHTML = '<object width="100%" height="100%" type="text/html" data="text.html"></object>';
var pre = x.substring(0,5);
alert(pre);
}
</script>
</body>