Wrox Programmer Forums
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 30th, 2005, 09:50 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 139
Thanks: 0
Thanked 0 Times in 0 Posts
Default Reading from a page

Hi,

I would like to know if it's possible or not, I have this page 2 frames. 1 frame I don't control the content, but is always in the same format but w/ different values. I would like to 'read' the information that would be displayed from the other frame, where I could use the data.

Cheers,

 
Old September 30th, 2005, 09:59 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi darkhalf,

It should be fine to do this client-side if the pages are in the same domain, however if not you will get an "Access Denied" type error with most browsers.

HTH,

Chris

 
Old September 30th, 2005, 10:03 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 139
Thanks: 0
Thanked 0 Times in 0 Posts
Default

but how would one go about to read the information? I found this, which gives me the html of the page in question, but how could I test for the values? And if the page is not in the same domain, it won't work at all? Not even through an hta for example?

function extract() {
    if (document.all)
        for (var i=0;i < parent.fr1.document.all.length; i++)
            if (parent.fr1.document.all(i).tagName == 'TABLE')
                alert(parent.fr1.document.all(i).outerHTML);
}

 
Old September 30th, 2005, 10:10 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 139
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Actually, disregard my last message. I understand how to make it look for specifics. But how do you get aroudn the domain problem? The page which I'm trying to read is not one of my own, and won't be on the same domain. Is there no way to get around that?

 
Old September 30th, 2005, 10:21 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

I think you will have problems doing this client-side.

If you have some sort of server-side processing available e.g. asp, you could use objects such as ServerXmlHttp to access the page content while you are building your page (assuming the site in question is happy about you doing this).








Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading a E-mail dayancode C# 3 August 22nd, 2008 08:22 AM
Reading An int Doom C# 1 January 7th, 2008 01:43 PM
Posting to Another Page & reading data posted geo54321 C# 1 February 19th, 2007 12:22 PM
reading data darkhalf XSLT 1 September 7th, 2006 02:51 PM
reading emails santosh82 VB.NET 2002/2003 Basics 0 May 24th, 2006 07:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.