Results 1 to 31 of 31

Thread: A html page inside a layer or a td???

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343

    A html page inside a layer or a td???

    Can a html page be shown inside a layer or rather a td??

    If I cant get the layer above two frames, I will have to make the two frames into one. But I dont want the menu "side" to load every time a button gets clicked.... Can I load a html page into a td?? Do I have to grab just the code between the body tags??

    /Smirre
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  2. #2
    scoutt
    Guest
    only with SSI or serverside code liek php or asp or cgi.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343
    No problem I can use asp. How is it done??? I dont want to reload the menu....

    /Smirre
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    <!--#include file="thefiletobeincluded.html"-->

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343
    I know of the include, but that will include everything in that html file??

    If I make an include I will have two heads, two bodys, and so on. Will this screw up anything in the browsers. When i tried to add a html page inside a html page, it has worked fine in IE and NS 6.0. Will it work in IE4.0+ and NS 4.0+???


    And when the visitor clicks on the menu I have to reload the page with the menu to....

    Can a TD's content be changed with innerHTML and document.write??? I mean with this amount of html code must be changed???

    Proberly reloading the page and the menu will be faster...

    /Smirre
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  6. #6
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    The source should work in NS4 is its an asp page with ASP working against the server rather the the client. ASP takes the source and compiles it to a HTML page and displays that.


    Why dont you use an IFrame in your TD?

    <iframe src="file.htm">

    where src is you html file. The IFrame appears with a border but you can turn it off with settings, do a search through google to find details on it.

    You can change the contents of a TD with innerHTML but but cant read a file with javascript so the code would have to be written in javascript.

    document.getElementById('td1').innerHTML = '<span>Hello!</span>';
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343
    Will Iframe work in Netscape and IE???
    What versions in that case??


    How do I change the Iframes src ??? Should I use a javascript and use innerHTML and document.write metod and write a new iframe tag inside my td??

    Give me some tips on how this can be solved...

    Thanks for all the help everyone!

    /Smirre
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  8. #8
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    IFrame supported in IE 3 +, NS 6
    ILayer supported by NS 4

    Basically, you'll have to use navigator.appName/Version to get the clients browser name/version number...

    if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion >= "4.0")
    {isIE = True; version = 4;}

    if (navigator.appName == "Netscape" && navigator.appVersion >= "4.0")
    {isNS = True; version = 4;}

    ... and you'll have to use generate an IFrame or ILayer dynamically using javascript. Either that or you can do this...

    <td><IFrame id="iframe1"><ILayer id="ilayer1"></td>

    ... and you can use javascript ot change the src.

    if (isIE=true){
    document.all('iframe1').src = 'file.htm';
    }else{
    document.getElementById('ilayer1').src = 'file.htm';
    }


    I've never actually done anything like this before so this really just a test.

    Let me know how you get on.
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343
    I have tried the IFrame tips you gave me.

    It works super. The src can be changed, and when the src is changed the iframe is reloaded...

    Dont know about the Ilayer, does it have the same function or??

    I have to get hold of a netscape broswer lower than 6.0....

    /Smirre
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  10. #10
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  11. #11
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343
    What version of Netscape do you think I should test the site with??

    I dont know what version is the most common??

    /Smirre
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  13. #13
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    well, i'd test it with 4 and 6. I'm not sure if you can have 2 versions installed on same pc. I have 2 PCs, one with netscape 4 and the other with 6 to test compatibility.

    Test with version 4 for now, then if your happy, upgrade to 6 and restest.
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  14. #14

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343
    The 4.0 version??

    After some more testing with IFrame I noticed that with Netscape you cant set the width and height to 100%.

    Hm...

    The I must retrive the height and width of the main table, and the td width..... And set these values at loading the page...

    Any other ideas??

    /Smirre
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  15. #15
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    Can you set it to 100% using CSS?

    <IFrame style="position:absolute; width:100%; height:100%;">

    or HTML?

    <IFrame width="100%" height="100%">
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  16. #16

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343
    Have tried both with HTML, inline styles and a seperate stylesheet....

    None works....

    /Smirre
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  17. #17
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    hmm, not sure really...

    have a look at these IFrame docs to see if you can figure anything outhttp://www.w3schools.com/html/attr_iframe.asp

    you could try using DHTML... use javascript to set the width and height to what you require once the page is loaded

    Netscape version 4.0 to your last question btw
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  18. #18
    scoutt
    Guest
    Originally posted by punkpie_uk
    well, i'd test it with 4 and 6. I'm not sure if you can have 2 versions installed on same pc. I have 2 PCs, one with netscape 4 and the other with 6 to test compatibility.

    Test with version 4 for now, then if your happy, upgrade to 6 and restest.
    you can have NS4.+ and NS6.2 installed on the same pc. it's not like IE where you can't have different version installed.

    remember smirre, Iframe doesn't work in NS4.+, so make sure you are setting the height and width of that layer instead.

  19. #19
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    I'm not sure about this one. I know for a fact that elements such as <Select>, <Iframe> are counted as windows components and are by default given the highest zorder on the page so this probably true of Netscape.

    But if you say that the <iframe> now works in internet explorer but not in Netscape then its probably something they've changed in Internet Explorer 6 but not Netscape 6?!?!?

    You could try using CSS nad set the ZOrder but I think I tried that a while back and it didn't work...
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  20. #20

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343
    Tried the Z-index, (isnt that the z-order??), no good....

    Any other way to show a html page inside a td or on a layer??

    /Smirre
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  21. #21
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    Yeah, sorry thats Z-Index I always make that mistake...

    You could put the body content of the document in an external file (just the body content still though because you'll end up with two <head> and <body>) and use a ssi to read the content.

    <td id="atd">
    <!--#include file="include.htm" -->
    </td>

    Or you could set the content using document.getElementById('atd').innerHTML and have the content in an external js file.

    I'd use the first idea because you don't have to mess with javascript BUT if this is for an online site then make sure the host supports SSI.
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  22. #22

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343
    Can a file be read with client side java script???

    Like read a html file??

    /Smirre
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  23. #23
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    No, javascript cant read external files, it can only link to external js files.
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  24. #24

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343
    Looks like I'm going to have to make two diffrent web sites...

    One IE and ONE NS....

    ....

    /Smirre
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  25. #25
    scoutt
    Guest
    whats wrong with SSI? mosdt ISP's have it enabled.

    all you would have to do is put a div tag in there that will scroll, then have that include SSI statement and it should pop right in to it.

    that is why I like php, you can include a file anywhere and don't have to worry about SSI or iframes.

    you could just make the table expand to the size of the html page being included, and then you wouldn't need to put scroll bars in there.

    jsut some thoughts here.

  26. #26

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343
    That would create a page that has two heads, two bodys and so on.

    Can this "crash" a page???

    Or do I have to write a function that removes everything to the end of the start body tag, and everything from the beging of the stop body tag???

    What will happen if the user that creates a page with frontpage desides to use % in tables?? Seen that doesnt work so very well with netscape.... (nested tables)...

    /Smirre
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  27. #27

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343
    How do I make a DIV scrollable in IE and Netscape??

    Only the div....

    /Smirre
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  28. #28
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    It wouldn't crash the page but it'd probably display the content a little bizzare. Tyr it, see what happens
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  29. #29
    scoutt
    Guest
    Originally posted by Smirre
    That would create a page that has two heads, two bodys and so on.

    Can this "crash" a page???

    Or do I have to write a function that removes everything to the end of the start body tag, and everything from the beging of the stop body tag???

    What will happen if the user that creates a page with frontpage desides to use % in tables?? Seen that doesnt work so very well with netscape.... (nested tables)...

    /Smirre
    never had a problem with % in netscape tables. just have to know how to do it.

    I think you can use that ssi and the page you include doesn't have to have a body or head tag. why would it if the page you are putting it in already has one? it can be just palin text as far as I know.

  30. #30

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Location
    Kalix, Norrbotten, SWEDEN
    Posts
    343
    I meant that the page has a Head and body....... Then my new page gets two heads and two bodys.....

    This could f..k things up???

    /Smirre
    Visual Basic
    C, C++
    Java
    Access
    SQL Server

    MCP, MCSD

  31. #31
    scoutt
    Guest
    the only reason you need a head in the page you include is because you might have some javascript you want to use. so just put it in the main page ane do away with the head and body tags.

Posting Permissions

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



Click Here to Expand Forum to Full Width