HTML Data Question

Discussion in 'Mac Help/Tips' started by firewire2001, Dec 30, 2002.

  1. firewire2001 macrumors 6502a

    Joined:
    Apr 2, 2002
    Location:
    Hong Kong
    #1
    Hey...

    I'm trying to set up a website for an online radio station and one thing i want to implement is the ability to see the current playlist from the front page.

    I have an html file that is constantly updated with such information, however, i would like to put the updated contents of this html file on the main page of this site - but the catch is that i don't want to do it without using frames because of the design.

    Any ideas? Any Javascript i could use to do this?

    Thanks in advance...
     
  2. barkmonster macrumors 68020

    barkmonster

    Joined:
    Dec 3, 2001
    Location:
    Lancashire
    #2
    If you definately don't care about netscape 4.x users (heard of 7 yet, tried it ?) you're perfectly fine using iframes.

    It's very simple, they're inline elements so they can be treated much the same as image tags. They're not like normal frames so they're very handy for this kind of thing.

    here's the code add a 100 x 100 pixel iFrame to a page, just change yourpage.htm to whatever you call the second htm file containing the playlist. You should give the iFrame a name just incase you want to link other documents to it from the page it's contained in.

    Code:
    <iframe src="yourpage.htm" name="whatever" width="100" height="100" align="middle" frameborder="0" marginwidth="0" marginheight="0" scrolling="auto">
    </iframe>
    
    There's a bug in internet explorer on the mac that crops up sometimes with any kind of frames if you change the contents often or even the first time they load and the height is larger than the height of the window. I put this javascript code in between the head tags to solve it. You need to call the code with an onload event in the body tags too, this is in the code below aswell.

    Code:
    <HEAD>
    <SCRIPT LANGUAGE="Javascript"><!--
    function ieMacFix(){if(document.all&&(navigator.platform.indexOf("Mac") != -1)){
    window.resizeBy(0,-1); window.resizeBy(0,+1);}}
    //-->
    </SCRIPT>
    </HEAD>
    <BODY onload="ieMacFix()">
    
    Hope this helps.
     
  3. whfsdude macrumors 6502a

    Joined:
    Jan 20, 2002
    Location:
    Washington DC USA
    #3
    Doesn't icecast have some kind of php script that you can put on your site? I think that would be the way to go :)
     
  4. yamadataro macrumors 6502

    #4
    I've had a similar situation when I was working on a major Sony site.
    We've considered JavaScript, new HTML tags, flash etc.
    You can impliment static HTML way to embed another file's content, but you'd experience a lot of imcompatibility issues with old browser.

    If the high compatibility is your agenda:

    If your server allows you to run PHP scripts, do it with PHP. You can embed anything with PHP real easily. And, of course, if you don't want to make your file's extension to be PHP, you can configure Apache to read .html files as PHP dynamic file (although this depends on what your ISP allows you to do).
     

Share This Page