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?
A:
You can use JavaScript to access the parent:
window.parent.document.title
Nelson
2009-07-16 19:04:37
Ah, I missed the part about it being a separate server.
Nelson
2009-07-16 19:05:36
does this apply to cross-server requests? you may be incorrect
Irwin
2009-07-16 19:06:07
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
2009-07-16 19:13:00