Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old February 12th, 2004, 02:21 PM
Jester Jester is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: England
Posts: 271 Jester User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Document Contents - Javascript

Hi all,

Can you used the open() method to open a window with a url, then after that window has fully loaded up use the handle to the new window (on the parent page) in order to read what is being displayed into a variable?

I cannot use php to simply get_file_contents due to the circumstances that this is occuring, and DOM will not work as the text I need is not contained in <BODY> tags - it is simply a datadump with no HTML...

Anyone have any ideas as although I know how to write to the document property of a window, I cannot seem to find how to read...

Reply With Quote
  #2  
Old February 12th, 2004, 02:31 PM
nawlej nawlej is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Dallas, Tx. USA
Posts: 2,008 nawlej User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 7 m 51 sec
Reputation Power: 4
RE: Document Contents - Javascript

you sure can....but both of your windows have to have names....just assign the variable to the window object and it should store the contents.

Reply With Quote
  #3  
Old February 13th, 2004, 08:59 AM
Jester Jester is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: England
Posts: 271 Jester User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Document Contents - Javascript

Thank you for your time - this looks like what I need, but cannot get it to work...!

Do you think you could post an quick example?

Reply With Quote
  #4  
Old February 16th, 2004, 03:56 PM
Jester Jester is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: England
Posts: 271 Jester User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Document Contents - Javascript

It's okay - I sorted it:
Code:
<html>
  <head>
    <script>
      function checkPage() {
        if (dumphdl.document.readyState == 'complete') {
	  body = dumphdl.document.body;
	    var children = body.childNodes;
	    for(var i=0; i<children.length; i++){
	      document.write(children[i].nodeValue);
	    }
	    dumphdl.close();
	    return;
        }
	setTimeout('checkPage()',100);
      }
			
      var dumphdl = window.open("path_to_page","dump");
      checkPage();			
    </script>
  </head>
</html>


In place of the document.write you can write dynamically created <input type=hidden> controls to hold the data, then do a form submit and post back to PHP_SELF in order to grab and manipulate via php... (which is my next job :laugh: )

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Document Contents - Javascript


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT