set iFrame title for the page

Posted on 2011-09-11
Last Modified: 2012-05-12
Hello Experts,
 How do I in my following page, get the iframe title to be the page title

 how do I can do it by the Setup function ?

<script type="text/javascript">
    function setup() {
        var ifrms = parent.document.getElementsByTagName("aa");
        if (ifrms.length > 0) { // We're embedded
            parent.document.title = "example";
        } else {
            document.body.innerHtml = "Content";
</head><body onLoad="setup();">
<iframe id = "aa" name = "aa" src='' > </iframe> 

Open in new window

Question by:madmare
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 36518548
This cannot be done in HTML, you could do a curl in php and get the page title and put it between the title tags.
LVL 27

Accepted Solution

rrz earned 500 total points
ID: 36519201
<script type="text/javascript">
    function setup() {
        var ifrms = document.getElementById("aa");
            document.title = document.aa.document.title;
</head><body onLoad="setup();">
<iframe id = "aa" name = "aa" src='' > </iframe> 

Open in new window

The error that is raised is
"Access is denied."
Look at 
There is a lot of talk about workarounds,or.r_gc.r_pw.&fp=c7fec8890f99dfa5&biw=1280&bih=856 
I don't know if they will work.  


Expert Comment

ID: 36541440
document.write('<iframe src="'+document.title+'&url='+window.location+'" frameborder="0" scrolling="no"></iframe>');

Open in new window


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
What cart is this? 2 55
Validating number not work with decimal 4 46
Display Flex does not Wrap Items 2 46
output in HTML format powershell 6 50
Find out what you should include to make the best professional email signature for your organization.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remaiā€¦
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question