www.webdeveloper.com
Results 1 to 9 of 9

Thread: Change the font color in Iframed Page

  1. #1
    Join Date
    Apr 2009
    Posts
    4

    Exclamation Change the font color in Iframed Page

    Hi,

    I need to change the background and font color of the iframed page same as the main page of my site where it is iframed ?

    How to achieve this ?

    Thanks
    Vijay

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Is the iframe page in your domain?

  3. #3
    Join Date
    Apr 2009
    Posts
    4

    Exclamation

    Yes the Iframed page is on my domain , I am calling it from another page on my domain.

  4. #4
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Code:
    <script type="text/javascript">
    window.onload=function() {
    frames[0].document.body.style.cssText+=';background:gray;color:red;';
    };
    </script>

  5. #5
    Join Date
    Apr 2009
    Posts
    4
    I tried it, its giving the below error in firebug
    frames[0] has no properties

  6. #6
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Then you have no same domain iframe documents or the iframe document has not loaded.
    Last edited by Fang; 04-20-2009 at 08:15 AM.

  7. #7
    Join Date
    Apr 2009
    Posts
    4
    If it's not on same domain, how to achieve it ?

  8. #8
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    You can't.

  9. #9
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    Quote Originally Posted by vijayshekar View Post
    If it's not on same domain, how to achieve it ?
    If you own the domain that the iframe itself is on then you can change the code there.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles