[Javascript] Get URL and Title from page in another frame??

Ciko, David david_ciko at merck.com
Thu Mar 29 11:52:07 CST 2001


Thanks, 

I see the permissions issue, doesn't look like I'll be able to get this done
then.


-----Original Message-----
From: Rodney Myers [mailto:rmyers at i-way.co.uk]
Sent: Thursday 29 March 2001 12:13
To: javascript at LaTech.edu
Subject: Re: [Javascript] Get URL and Title from page in another frame??


David,

It will only be possible to do this (without very special security
privileges which are unlikely to be practical) if the pages are from the
same domain and protocol. So not with third party pages from other
sites. So ... you say all the pages are from one site. Fine!

Imagine a two frame frameset with frames called nav and main.

Here we are in nav looking at the file in main:

> to retrieve the URL
var mainUrl=""+parent.main.location;

// note the ""+ which forces the resulting value to be a string, which
otherwise it is not which can cause errors when e.g examining it with
string methods such as indexOf()


> and Title of a page in another frame??
var mainTitle = parent.main.document.title;

hth

Rodney


> "Ciko, David" wrote:
> 
> I'm wondering if it's possible, using Javascript, to retrieve the URL
> and Title of a page in another frame??
> 
> I'm looking to have a 'bookmark this link' script that will add a
> bookmark for the framed page, as well as have another link to remove
> the frame and open in it's own window.
> 
> Thanks for the help,
> David

-- 
Shop at ssistant Add-ons and Developer Workshops
http://www.aflyingstart.net/addons/
STILL PLACES OPEN on Fri 27 April workshop

Courses in April 
Mon 23  : Making a Start in E-Commerce with Shop at ssistant
Tue 24  : Meeting Business Needs with the Shop at ssistant Classic system
Wed 25 : Building Better Shopping Pages with Shop at ssistant Classic


Booking for these Shop at ssistant Classic courses at 
http://www.shopassistant.net/training/  
Or call 01256 880770

Rodney Myers
Based in Oxford, England
Technical Director, Shop at ssistant eCommerce Solutions

_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
http://www.LaTech.edu/mailman/listinfo/javascript




More information about the Javascript mailing list