HighDots Forums  

Loading HTML-page without activating it

Javascript JavaScript language (comp.lang.javascript)


Discuss Loading HTML-page without activating it in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jeppe 1971
 
Posts: n/a

Default Loading HTML-page without activating it - 12-04-2003 , 08:26 AM






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

Reply With Quote
  #2  
Old   
Richard Cornford
 
Posts: n/a

Default Re: Loading HTML-page without activating it - 12-04-2003 , 09:44 AM






"Jeppe 1971" <jeppe1971 (AT) jubiimail (DOT) dk> wrote

Quote:
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.

<snip>
Quote:
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.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.