Loading HTML-page without activating it

J

Jeppe 1971

Hi

Does anyone know of a way to load a HTML-page and examine the document
without activating the code?

I am trying to create a search-function in javascript.
The idea is that the function goes through all the HTML-pages on a
site looking for words entered by the user. The results is thereafter
presented to the user (it's a kind of a search-engine).

Creating the search-function is easy. I can do that myself.

The problem is that I can not find a way to load the HTML-pages
without activating them. Whenever a page is loaded into e.g. an
<OBJECT> or <IFRAME> it is activated. And if the body onload-event has
an alert-message, the user will be shown 50 alert-boxes, if there are
50 pages to go through. Not very smart ...

I need a way to pass the loaded document into a string before it is activated.

Best regards,

Jeppe Andersen
 
R

Richard Cornford

Jeppe 1971 said:
Does anyone know of a way to load a HTML-page and examine
the document without activating the code?

I am trying to create a search-function in javascript.
The idea is that the function goes through all the
HTML-pages on a site looking for words entered by the user.
The results is thereafter presented to the user (it's a kind
of a search-engine).

What you are proposing is that for _each_and_every_ search request made
the user downloads the entire web site. You have got to be on broadband
(or something better) to even be considering such a ridiculous scheme.

I need a way to pass the loaded document into a string before
it is activated.

Generally you can't but if you are willing to only impose this nonsense
on the users of a couple of types of web browsers you could look at
XMLHttpRequest and its ActiveX (near) equivalent. You will be able to
find references and examples searching on Google (note: that is a real
search engine and will not make you download the entire world wide web
in order to find out what is on it).

Richard.
 

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

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top