Web Analytics Made Easy -
StatCounter File reading and pointing file contents to div or iframe - CodingForum

Announcement

Collapse
No announcement yet.

File reading and pointing file contents to div or iframe

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • File reading and pointing file contents to div or iframe

    Greetings. I'm having a small problem with trying to read the contents of an auto-generated .html file which I'm trying to pass to a div when a user clicks a link. If anyone can offer suggestion to make this work, it would be greatly appreciated. Here's what I have.

    PHP Code:
    <script>
    ns4 = (document.layers)? true:false
    ie4 
    = (document.all)? true:false

    function loadOnline(page) {
        if (
    ns4document.mainContent.src page
        
    else if (ie4parent.mainContent.document.location page
    }
    </
    script>

    <
    a href="javascript:loadOnline('online.html');" onMouseover "window.status='Who\'s online at AWW';return true">
                                  
    Who's Playing

    <div ID="mainContent">
    <IFRAME name="mainContent" src="online.html" STYLE="display:none"
     SCROLLING="No" WIDTH="300" HEIGHT="200" MARGINWIDTH=0 MARGINHEIGHT=0 FRAMEBORDER="No">
    </iframe>
    </div> 
    Pardon the formatting... Looks like a couple of spaces have been auto-inserted.
    if ( bad && possible ) happen();
    Sig re-written for faster processing...

  • #2
    You cannot read external HTML files using JavaScript and then pass it on to a <DIV>...........you need server-side OR you could do with client-side JavaScript and XML........though not all browsers will support it.

    Some related links :
    This is a XML based JavaScript Ticker that can tick any number of messages.




    Scripting | JavaScripts | PerlScripts | Python Scripts | Articles | My Journal

    Comment

    Working...
    X