Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

viewing document.written javascript

0 views
Skip to first unread message

Jeff Thies

unread,
Dec 7, 1998, 3:00:00 AM12/7/98
to
I'm document.writing javascript functions (I'm writing the whole
page) to a child window.

This works, the javascript works, but it does not show up in the
source.
If you save the page, the javascript is not there. Only the HTML is
visible.

This is in NS4.04. I haven't tried IE (IE browser is down, Net slow to
download new) Is this normal, is there a way around this, or is there a
browser that will show this?

Sample code below...

Jeff

/*
<html>
<head>
<script language="javascript">
function openWriter(){
var t="t"
var form_writer = window.open("","","menubar")
form_writer.document.open()
form_writer.document.writeln('<html><head>')
form_writer.document.writeln('<scrip'+t+' language="javascript">');
form_writer.document.writeln('function a(){alert("open sesame")}')
form_writer.document.writeln('</scrip'+t+'></head>');
form_writer.document.writeln('<body>')
form_writer.document.writeln('<a href="javascript:a()">alert</a>')
form_writer.document.writeln('</body></html>')
form_writer.document.close()
}
</script>
</head>
<body>
<a href="javascript:openWriter()">write window</a>
</body>
</html>
*/


SykicPhyst

unread,
Dec 8, 1998, 3:00:00 AM12/8/98
to
Mr. Thies,
If you have read the documentation by Netscape on JavaScript, you would know
that in order to view the source, the protocol is
view-source://file.address.to.view.html. When viewing the source, use this
protocol, instead of "view source" from the menu.


===============================
"Skaman" Sam (sykic...@aol.com)
President / Webmaster
Fightin' Irish Inc.

The Hell Factory -- http://members.aol.com/skamansam
Tate Street Online -- http://members.aol.com/tatestreet
===============================

Jeff Thies

unread,
Dec 8, 1998, 3:00:00 AM12/8/98
to
> Mr. Thies,
> If you have read the documentation by Netscape on JavaScript, you would know
> that in order to view the source, the protocol is
> view-source://file.address.to.view.html. When viewing the source, use this
> protocol, instead of "view source" from the menu.

Actually, what I'm doing is generating web pages with embedded javascript arrays. The
end object is to save the created webpage. If I save the page, there is no javascript,
even though the javascript in the page functions. Sorry to mislead you about viewing
source, the object is to save the code.

Jeff

Jim Ley

unread,
Dec 8, 1998, 3:00:00 AM12/8/98
to
On Mon, 07 Dec 1998 23:39:03 -0500, Jeff Thies
<cybe...@sprintmail.com> wrote:

> I'm document.writing javascript functions (I'm writing the whole
>page) to a child window.
>
> This works, the javascript works, but it does not show up in the
>source.
>If you save the page, the javascript is not there. Only the HTML is
>visible.
>
> This is in NS4.04. I haven't tried IE (IE browser is down, Net slow to
>download new) Is this normal, is there a way around this, or is there a
>browser that will show this?

In 4.5 (full version) the same thing happens, when you click on save
file on a generated page for some reason it attempts to save the
wysiwyg: version,
(in response to the othe guys post view-source of such a page gives
the source of the parent page.)

Under my version of IE4 (4.71.1712.6) I get compete garbage under the
save as... however view source works correctly (using notepad as
external viewer), IE4 also puts the files in your temp direcrory... so
it's very stupid that save as doesn't work....

Is it really a problem though? or do you want to use a webpage to
write another, in which case instead of writing it to a new page,
write it to a textarea and then cut and paste it out to a file, or use
Ie4 and view source and then save..

>
>Sample code below...


Jim.

Jeff Thies

unread,
Dec 8, 1998, 3:00:00 AM12/8/98
to
> In 4.5 (full version) the same thing happens, when you click on save
> file on a generated page for some reason it attempts to save the
> wysiwyg: version,
> (in response to the othe guys post view-source of such a page gives
> the source of the parent page.)
>
> Is it really a problem though? or do you want to use a webpage to
> write another, in which case instead of writing it to a new page,
> write it to a textarea and then cut and paste it out to a file, or use
> Ie4 and view source and then save..

Thanks, I had wanted to automate the process and thought it was worth a shot.
I had thought of the text area and then got inspired. I think I've figured a
work around using document.referrer to write a bad script tag.

Jeff

>
>
> >
> >Sample code below...
>
> Jim.

0 new messages