SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS styling iframe page

    I have an affiliate shop with order page loading in iframe from another domain. I'm looking for a way to change CSS style of this iframe-page.

    mysite.com/buy.html looks like this:
    Code:
    <HTML>
    <HEAD>
    
    <script type="text/javascript">
    function styleIFrame()
    { document.frames['orderframe'].document.body.style.backgroundColor="green";
    }
    </script>
    
    </HEAD>
    <body onload="styleIFrame();">
    
    <iframe id="orderframe" name="orderframe" src="https://ANOTHERdomain.com/order.html"></iframe>
    
    </body>
    </html>
    IE 6 throws JS-error: "Access is denied". I think this is because domains differ or because of httpS of iframe src. Are there any workarounds? Thanks.

  2. #2
    do righteous deeds
    Join Date
    Aug 2006
    Location
    Türkiye Turkey تركيى
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
     
    <HTML>
    <HEAD>
    
    <script type="text/javascript">
    function styleIFrame()
    { 
    parent.frames['orderframe'].document.body.style.backgroundColor="yellow";
    
    }
    </script>
    
    </HEAD>
    <body onload="styleIFrame();">
    
    <iframe id="orderframe" name="orderframe" src="fromCharCode.htm"></iframe>
    
    </body>
    </html>

  3. #3
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I get the same access denied error. The problem I suppose is that you are testing on a local page 'fromCharCode.htm', but I need to work with external url like 'https://ANOTHERdomain.com/order.html'


Bookmarks

Posting Permissions

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