Click to See Complete Forum and Search --> : Newbe asking: Hoew can i assign the whole content of a Document to a variable?
jan.g
07-21-2003, 02:38 PM
Newbe asking: How can i assign the whole content of a Document to a variable? Not using the "all" comand? Is there a method that works cross browsers.
My Main problem is: I have to find a certain word in a document top get the following words with "indexOf". Then i want to hand them to another Page.
Tahnks a lot in for any help
Jan
Exuro
07-21-2003, 02:45 PM
I'm not sure that I know what you're doing, but I think I have an idea... Pyro posted this on another thread the other day:
contents = document.getElementsByTagName("body")[0].innerHTML;
I think that may be what you were looking for... Hope that helps!
jan.g
07-21-2003, 02:53 PM
This is a grat idea. Thank you very much. I'll try it right away.
jan.g
07-21-2003, 03:31 PM
Is it true that this method is only avaylable in Browsers since NS 6.x and IE 5.x? Then I'll have to find another way. Is there an equivlent method available for the earlier browser versions, or evan a complete different way to solve the problem?
To explain it maybe a little more detailed, I need to extract an article description out of the content of a page. The article is introduced with the word "article:", followed by a variable number of charakters. These Characters i have to get and display them in another page.
ThanX once again for every help
Jan