NEWBIE : undecoding javascript

R

royalmp2001

I have course notes in html that I can view in IE6, whose text I want
to copy and paste into a MS Word doc.
However, the html does not allow it and if I look at the file in
wordpad it is decoded javascript.
I know NOTHING about JAVA, JAVASCRIPT or HTML programming... and just
want to access the text instead of retyping the many, many pages of it.
The html file has the following command a little way down..

<SCRIPT LANGUAGE="JavaScript"><!--
function Decode() {

Is there something I can do?? some clever utility or
something...remember I am no programmer!!!

Thanks
royalmp2001
 
D

David Dorward

royalmp2001 said:
I have course notes in html that I can view in IE6, whose text I want
to copy and paste into a MS Word doc.
However, the html does not allow it and if I look at the file in
wordpad it is decoded javascript.

Open the Mozilla DOM Inspector, it comes with FireFox but isn't installed by
default (If you are a Windows user, do a custom install and you can select
it). (Press Ctrl+Shift+I to open it).

The lower left part of the DOM Inspector window will have an expanding tree
of the document. Right click on the HTML bit of the tree and picked "Copy
XML".

Paste this into a text file and save it with a .html extension. Open that,
and you should be OK.
 
D

David Dorward

royalmp2001 said:
I did all that, but on opening it finally, it was still encoded.

As far as I know, that should have decoded any JavaScript tricks. Perhaps
you misdiagnosed the problem - without seeing the page its rather hard to
tell.
 
G

Guest

I have course notes in html that I can view in IE6, whose text I want
to copy and paste into a MS Word doc.
However, the html does not allow it and if I look at the file in
wordpad it is decoded javascript.
I know NOTHING about JAVA, JAVASCRIPT or HTML programming... and just
want to access the text instead of retyping the many, many pages of it.
The html file has the following command a little way down..

<SCRIPT LANGUAGE="JavaScript"><!--
function Decode() {

Is there something I can do?? some clever utility or
something...remember I am no programmer!!!

There are various ways depending on precisely what is done.

IF the page simply decodes and writes to the main page, there
are utilities which will show what the page is like after it
is loaded and interpreted by the browser (one is included below).

However, it may, for example, be a page with frames and the decoded
version may be put in a frame (and the utility below will show
the main page, the frameset, and its code, not the framed content).

If the only problem is that you cannot copy/paste because Javascript
is blocking you from highlighting data to select it, you can try
turning off Javascript. In IE this will probably not work for it
will probably reload the page (and the decoded version will disappear)
(pages can have [noscript] sections and if the page were not reloaded,
after turning off Javascript, the page may have javascript URLs which
would not work - but reloading it and using the [noscript] section,
it would have a page designed to work without Javascript). Mozilla/Firefox
will probably NOT reload the page so if you open it in Mozilla and
go to EDIT|PREFERENCES|ADVANCED|SCRIPTS you should be able to turn off
Javascript after loading a page. Can you then copy, paste? You will
have to renable Javascript for the next page, so the decoding function
will work.

Here is a little utility (there are versions of this sort of thing all
over the 'web) to display a page after it is loaded and interpreted
(in particular, after any onload Javascript has changed the page)
by the browser.


========================================
MODIFIED:

This version replaces all CHR$(0)'s in the page with [CHR$(0)]
to allow one to copy and paste the page (at least in Netscape 6.3
under Linux).

It modifies the output string with 'replace(/\x00/g,"[CHRS(0)]")'
====================================================================

I came across a page where the decoder was broken and produced a
couple of CHR$(0)'s in the output. One could see the output using
this, but could not copy it beyond the first CHR$(0).

JavaScript URL (add as a link on the personal toolbar to make this as an
additional browser command) to view the current(*) contents of the current
page.

(*): The contents may change if the page is self-modifying, i.e. uses
JavaScript and "document.write()" to modify the page as it loads. If
this happens, the current content will not be the same as the as the
source code one could view with the browsers "VIEW|SOURCE" command.

One can view the entire page (head, body, frameset sections, etc. - the
entire page) at once by using the root "property" of the page (the
HTML:
...
section). Instead of getting by the tag name of "html" one
can use the DOM Level 1 property "documentElement".

This JavaScript URL sets the value of the textarea to that of the content
one wants to see (instead of putting the content in with a document.write(.)
which would close the TEXTAREA if the target page happens to have a form
with a textarea of its own) and it does not just show the body of the page,
but the root element - the entire page.

It works in Netscape 6.2.1 in Linux, at least (on which I have tested it).
It simply relies on innerHTML and the DOM Level 1 "documentElement" property
for the page (the root element, that is, the entire
HTML:
...
content
of the page). I suspect it will work in the later versions of IE as well.

JavaScript URL to view the current contents of the current page in a pop-up
window (you can change the size parameters for the window and textarea to
reflect you monitor, resolution and font sizes) is:

<a href =
 
R

royalmp2001

Hi David, and Spamless

Well, spamless, your idea about turning javascript off doesn't work in
IE,and I couldn't find an option in Firefox to turn it off.
However, I have a solution, which I am recording for anyone else with
the same problem.

The solution is to load up the page, go to SAVE AS... and choose WEB
PAGE, COMPLETE, give it another file name and then call it up, and hey
presto, the decoding is done, and I am allowed to copy and
paste....Great.
Thanks for your ideas David and Spamless, particularly for all that
typing, spamless.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top