Closed Thread Icon

Topic awaiting preservation: Accessibility between domains (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8144" title="Pages that link to Topic awaiting preservation: Accessibility between domains (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Accessibility between domains <span class="small">(Page 1 of 1)</span>\

 
Yossi Admon
Bipolar (III) Inmate

From: Israel
Insane since: Nov 2001

posted posted 04-14-2002 20:39

Hi.

My problem related to access violation error.
I have a page where the user may type any URL, then the user press a button and I open a new window for the URL just entered.
I need to know if the page just opend is a frameset or a simple page, If it is a frameset I need to know all the child frames URL's.
Can I get this info and how?
I wrote something like the following code:
var strUrl = <Given valid URL>;
var oWin = window.open(strUrl);
if( oWin.frames.length > 0){
for(var i=0; i<oWin.frames.length; i++){
alert(oWin.frames[i].src);
}
}

All what I'm getting is alerts with "undefined" message.

Thanks in advanced
Yossi

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 04-14-2002 22:16

You can't access pages from outside your domain, even though the page might be in a child window of your page.

Unfortunately afaik this can't be done.



.:[ The Tao of Steve ]:.
Be Desireless
Be Excellent
Be Gone
...................................

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 04-15-2002 04:48

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 04-15-2002 18:22

Correction: in iexplore the default is set to "ask the user if it happens"

Yossi Admon
Bipolar (III) Inmate

From: Israel
Insane since: Nov 2001

posted posted 04-25-2002 19:46

What if in both pages I will use the same domain ?
I can write document.domain = "Mydomain" in both pages.

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 04-26-2002 02:15

You can of course try it but I doubt it would work. I'd assume that the browser doesn't parse the page in question before denying access.

(GRUMBLE on my IE6 WinXP version it's default is deny)



.:[ The Tao of Steve ]:.
Be Desireless
Be Excellent
Be Gone
...................................

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 04-26-2002 03:51

The domain of a page isn't a variable. It's the place where the page actually is. For instance, all the pages on this forum are under the "ozoneasylum.com" domain. www.slimeland.com/winsim is under the slimeland.com domain. You can't change the domain of a page without actually changing it's location.

So, you can't really get the URL of a page that the user went to. The reason is simple: say a user went to "www.freenudepics.com" or a page within their company's intranet or something of the sort. That's their own business, and they need to trust their browser to keep that information private.

Yossi Admon
Bipolar (III) Inmate

From: Israel
Insane since: Nov 2001

posted posted 05-14-2002 20:55

I found that I can reduce a part of the server domain for example:
If the 2 servers in the following domain aaa.xyz.com and bbb.xyz.com I can write in both pages (of 2 different servers) the followin code:
<script language="JavaScript">document.domain="xyz.com"</script>
and then access to each other, Or to add it only in the child window code and access it from the wrapper window.


« BackwardsOnwards »

Show Forum Drop Down Menu