Anyone know if there is a way to get the title string from an iframe src coming from another domain?
Announcement
Collapse
No announcement yet.
Pulling title from iframe cross domain
Collapse
X
-
you can get the .src attrib , but title sound more like it's coming from the document itself, which historically, you can't reach.
if you own the iframe'd page, you can add message passing events to respond to queries from the framing page. look into window.postMessage()...Create, Share, and Debug HTML pages and snippets with a cool new web app I helped create: pagedemos.com
-
-
Unless you have hundreds of possible <iframe> contents, why not just set up a table of correspondence between the .src of the <iframe> and the <title> of it?
That is:
Code:var theTitles = { "page2" : "Alligators", "page3" : "Bananas", ... }; var theTitle = theTitles[ iframeSrcStrippedToNameWithoutExtension ];
Be yourself. No one else is as qualified.
Comment
-
-
Originally posted by wyclef View Postany other suggestions? unable to get this to work
just grab the title element, and use the json w/callback flavor YQL output...Create, Share, and Debug HTML pages and snippets with a cool new web app I helped create: pagedemos.com
Comment
-
Comment