tags:

views:

202

answers:

3

I have a page that calls another page(on another server) and I want that page to read the title from the parent page. Is this possible or is there some security issue with this?

+2  A: 

You cannot communicate across servers like that.

Alex
A: 

You can use JavaScript to access the parent:

window.parent.document.title
Nelson
Ah, I missed the part about it being a separate server.
Nelson
does this apply to cross-server requests? you may be incorrect
Irwin
A: 

Call page A the caller page (with the JavaScript on it, the one requesting the title) and page B the page you want the title of.

Can you make a third page C (hosted on any server where A can access C and C can access B) which acts a go-between and servers up a JSON or XML request from the target page to the source page (where the JavaScript can call it?)? Page C could be any web app or CGI program capable of pulling down the HTML of page B and parsing it for the title, and then serving up the result in an AJAX friendly manner for page A to consume.

I suppose the usefulness of this depends on your goals and bigger-picture point of view of your project.

Jared Updike