www.webdeveloper.com
Results 1 to 6 of 6

Thread: [RESOLVED] iframe problem

  1. #1
    Join Date
    Jun 2012
    Posts
    48

    resolved [RESOLVED] iframe problem

    Hello all,

    I have a weird problem. I hope somebody can help me here.

    This code works in FF - Chrome - Opera - Safari but not in IE 9 and IE 10
    Code:
    <?php
    $_SESSION['url'] = "http://www.domainname.com/404.php";
    $taal = (substr($lang, 0, 2));
    ?>
    
    <iframe src="<?php echo $_SESSION['url'] ?>?taal=<?php echo $taal ?>" name="inline_frame" id="inline_frame" 
    width="100%" height="100%" frameborder="0" marginwidth="0" scrolling="no" allowTransparency="true" >
    This code works in IE 9 and IE 10 but not in FF - Chrome - Opera - Safari
    Code:
    <iframe src="http://www.domainname.com/404.php?taal=<?php echo(substr($lang, 0, 2))?>" name="inline_frame" id="inline_frame" 
    width="100%" height="100%" frameborder="0" marginwidth="0" scrolling="no" allowtransparency="true" >
    Is there a way to make it work in all browsers with only one code ?

    Thanks in advance
    Last edited by coderunner; 12-01-2013 at 08:26 PM.

  2. #2
    Join Date
    Mar 2011
    Posts
    1,144
    If you don't need to support older versions of Internet Explorer (IE<9), then I'd suggest using CSS and set the background color of the document being loaded into the <iframe> to 'transparent'.

    I'm surprised that the capitalization of the attribute name 'allowTransparency' makes a difference, but my brief research into 'allowtransparency' indicates that support is not uniform across all browsers. It started out as a proprietary attribute for Internet Explorer, and others started to support it later. It's obviously non-standard and relatively obscure, so you can't count on it going forward anyway.

    A 100% x 100% <iframe> looks like a bit of a hack as well. What are you actually trying to do here?
    Rick Trethewey
    Rainbo Design

  3. #3
    Join Date
    Jun 2012
    Posts
    48
    Hello rtrethewey,

    Thanks for your reply.

    It doesn't have anything to do with showing contents or not in the iframe, that's okay but in IE 10 it gives me a 404 error page (page not found)with the first code and with FF - Chrome - Opera - Safari it directs to the right page.

    Regards

  4. #4
    Join Date
    Mar 2011
    Posts
    1,144
    OK, you didn't explain what the problem was in your first message. The easiest way to find the problem is to load the page into both Internet Explorer and one of the other browsers and use "View Source" to look at the HTML code being seen by those browsers so you can check for a syntax error that one browser tolerates but the other can't handle. Running the page through an HTML validator would also be a good idea.
    Rick Trethewey
    Rainbo Design

  5. #5
    Join Date
    Jun 2012
    Posts
    48
    Okay rtrethewey I will follow your advice and try that out and I hope I can find the reason why.
    Thanks for your help!

    Regards

  6. #6
    Join Date
    Jun 2012
    Posts
    48
    The error was in my php code. I fixed it and now it's one code that works in all the browsers.

    Problem solved.

    Thank you for your time

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