loonatik
04-02-2003, 05:59 PM
i have this on my page:
<head>
<script language="javascript">
function viewNews(article) {
view=window.open("","view","fullscreen=0")
view.document.write("<html><head></head><body>")
view.document.write(article)
view.document.write("</body></html>")
view.window.resizeTo(400,300)
}
</script>
</head>
<body>
<a href="javascript:viewNews('my name is loonatik')">click here</a>
</body>
What this does is open a new window and writes 'my name is loonatik' to that new window.
But what I want is for the text to be written in the current window (no pop-up). Do I have to use innerHTML? I was looking for the effect of a viewnews.php. I'm using this to display articles so I wouldn't have to create separate pages for my 70+ articles. I've tried changing window.open to window.location and pointing it to a template, but it doesn't work. Any solutions?
Thanks.
<head>
<script language="javascript">
function viewNews(article) {
view=window.open("","view","fullscreen=0")
view.document.write("<html><head></head><body>")
view.document.write(article)
view.document.write("</body></html>")
view.window.resizeTo(400,300)
}
</script>
</head>
<body>
<a href="javascript:viewNews('my name is loonatik')">click here</a>
</body>
What this does is open a new window and writes 'my name is loonatik' to that new window.
But what I want is for the text to be written in the current window (no pop-up). Do I have to use innerHTML? I was looking for the effect of a viewnews.php. I'm using this to display articles so I wouldn't have to create separate pages for my 70+ articles. I've tried changing window.open to window.location and pointing it to a template, but it doesn't work. Any solutions?
Thanks.