www.webdeveloper.com
Results 1 to 4 of 4

Thread: Iframe Code is not working into Safari and Crome. It is working into IE 8.0

Hybrid View

  1. #1
    Join Date
    Sep 2012
    Location
    Delhi
    Posts
    5

    Question Iframe Code is not working into Safari and Crome. It is working into IE 8.0

    Hi,

    My web page code is below. I want to run a html framework where i used iframe code. It is working into IE8.0 and below version but it is not working into Safari or Crome. Can you help me in this. How can i run all my pages into the safari and crome.

    <!DOCTYPE HTML>
    <html>
    <head>
    <charset="utf-8">
    <title>Index page</title>
    <script>

    var urls = new Array('Page1.html','Page2.html','Page3.html','Page4.html');
    I=0;

    function next()
    {
    I+=1;
    if (I == urls.length-1)
    {
    document.getElementById("next").style.display = "none";
    }

    window.frames['links'].location.href=urls[I];
    document.getElementById('back').style.display='inherit';
    }

    function prev()
    {
    I-=1;
    if(I==0)
    {
    document.getElementById("back").style.display = "none";
    }
    window.frames['links'].location.href=urls[I];
    document.getElementById('next').style.display='inherit';
    }

    </script>
    </head>
    <body>
    <div id="main" style="border:solid #666; width:100%; height:auto;">
    <div id="header" style="border:solid #F00; width:99.5%; height:50px;">
    </div>
    <div id="middle" style="border:solid #099; width:99.5%; height:460px;">
    <div id="body_left" style="border:solid #006; width:29.50%; height:455px;">
    </div>
    <div id="body_right" style="border:solid #963; width:69.5%; height:455px; margin-left:auto; margin-top:-461px; position: relative;">
    <iframe src="page1.html" scrolling="auto" id="links" name="links" width="99.5%" height="450"></iframe>
    </div>
    </div>
    <div id="footer" style="border:solid #FF0; position: ; width:99.5%; height:auto;">
    <div id="footer_left" style="border:solid #0FF; width:79.475%; height:50px;">
    </div>
    <div id="footer_right" style="border:solid #6F6; width:19.4375%; height:50px; margin-left:auto; margin-top:-56px;">
    <div id="img_a" style="margin-top:10px; margin-left:30px;">
    <img src="images/previous_01.jpg" alt="Back" id="back" align="middle" class="hover" style="cursorointer" onclick="prev();"/>
    </div>
    <div id="img_b" style="margin-top:-30px; margin-left:80px; float">
    <img src="images/next_01.jpg" alt="Next" id="next" class="hover" align="middle" style="cursorointer" onclick="next();"/>
    </div>
    </div>
    </div>
    </div>
    </body>
    </html>

  2. #2
    Join Date
    Jul 2011
    Posts
    26
    I believe your server
    needs to send this header
    'X-XSS-Protection: 0'
    see if this thread describes
    your situation
    http://www.codingforums.com/showthread.php?t=253796

  3. #3
    Join Date
    Sep 2012
    Location
    Delhi
    Posts
    5
    No. It is not solving. Please do help me? What are the alternatives to load the content dynamically.

  4. #4
    Join Date
    Mar 2011
    Location
    Rome, Italy
    Posts
    101
    Try to replace the code like this:

    document.getElementById('links').location.href='url...'

    instead of:

    window.frames['links']...

    In my experience, the first soultion is cross-browser too (Firefox usually gives problems in iframes JS calling syntax).

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