Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    TEXAS . . . 'nuf said
    Posts
    468
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Netscape Hide SOME code (html) from N4.x (best option?)

    Quick background. I've been trying to put an iframe/ilayer/layer/whatevers on a page. But because of the positioning of it, Netscape 4.x just couldn't handle what I needed it to do. So...

    I've added some JS to the page for the links that I want Netscape 4.x to use. It works great. But, the second set of text/links are also visible. What can I add so that these second set of links aren't seen/used by N4.x users?

    I felt this was better than simply redirecting to a new page. This way, I just have to update one page (two spots) rather than two pages. But now I'm thinking the redirection for N4.x users might be the lesser of two evils. What do you think?

    Here's most of the code in question (ugly as it may be):
    Code:
                <table border="0" cellpadding="4" cellspacing="0" width="100%">
                  <tr>
                    <td valign="top" nowrap>
                <p><img src="../images/services_222x61.jpg" width="222" height="61" border="0"><br>
    <!-- BEGIN SPECIAL LINKS FOR NETSCAPE 4.X USERS -->
    <script language="JavaScript"> 
    <!--
    if (document.layers) {
    document.writeln('<img src="../images/1x1.gif" width="1" height="7" border="0"><br>');
    document.writeln('<a href="financial_audits_reviews.html">Financial Audits and Reviews</a><br>');
    document.writeln('<img src="../images/1x1.gif" width="1" height="7" border="0"><br>');
    document.writeln('<a href="compilation_write_up.html">Compilation & Write-Up</a><br>');
    document.writeln('<img src="../images/1x1.gif" width="1" height="7" border="0"><br>');
    document.writeln('<a href="high_tech_services.html">High Tech Services</a><br>');
    document.writeln('<img src="../images/1x1.gif" width="1" height="7" border="0"><br>');
    document.writeln('<a href="lending_services.html">Lending Services</a><br>');
    document.writeln('<img src="../images/1x1.gif" width="1" height="7" border="0"><br>');
    document.writeln('<a href="performance_improvement.html">Performance Improvement</a><br>');
    document.writeln('<img src="../images/1x1.gif" width="1" height="7" border="0"><br>');
    document.writeln('<a href="financial_projections_and_forecasts.html">Financial Projections and Forecasts</a><br>');
    document.writeln('<img src="../images/1x1.gif" width="1" height="7" border="0"><br>');
    document.writeln('<a href="investment_advisory_services.html">Investment Advisory Services</a><br>');
    document.writeln('<img src="../images/1x1.gif" width="1" height="7" border="0"><br>');
    document.writeln('<a href="tax.html">Tax</a><br>');
    document.writeln('<img src="../images/1x1.gif" width="1" height="7" border="0"><br>');
    document.writeln('<a href="mergers_acquisition_consulting_due_diligence.html">Mergers and Acquisition Consulting and Due Diligence</a><br>');
    document.writeln('<img src="../images/1x1.gif" width="1" height="7" border="0"><br>');
    document.writeln('<a href="sec_small_business_filers.html">SEC Small Business Filers</a><br>');
    document.writeln('<img src="../images/1x1.gif" width="1" height="7" border="0"><br>');
    document.writeln('<a href="tax_return_preparation_services.html">Tax Return Preparation Services</a><br>');
    document.writeln('<img src="../images/1x1.gif" width="1" height="7" border="0"><br>');
    document.writeln('<a href="controllership_start_up_services.html">Controllership and Start Up Services</a><br>');
    document.writeln('<img src="../images/1x1.gif" width="1" height="7" border="0"><br>');
    document.writeln('<a href="services_audit_committees_public_companies.html">Services for Audit Committees of Public Companies</a></p>');
    }
    //-->
    </script>
    <!-- END SPECIAL LINKS FOR NETSCAPE 4.X USERS -->
                <img src="../images/1x1.gif" width="1" height="7" border="0"><br>
                <a href="financial_audits_reviews.html" target="content">Financial Audits and Reviews</a><br>
                <img src="../images/1x1.gif" width="1" height="7" border="0"><br>
                <a href="compilation_write_up.html" target="content">Compilation & Write-Up</a><br>
                <img src="../images/1x1.gif" width="1" height="7" border="0"><br>
                <a href="high_tech_services.html" target="content">High Tech Services</a><br>
                <img src="../images/1x1.gif" width="1" height="7" border="0"><br>
                <a href="lending_services.html" target="content">Lending Services</a><br>
                <img src="../images/1x1.gif" width="1" height="7" border="0"><br>
                <a href="performance_improvement.html" target="content">Performance Improvement</a><br>
                <img src="../images/1x1.gif" width="1" height="7" border="0"><br>
                <a href="financial_projections_and_forecasts.html" target="content">Financial Projections and Forecasts</a><br>
                <img src="../images/1x1.gif" width="1" height="7" border="0"><br>
                <a href="investment_advisory_services.html" target="content">Investment Advisory Services</a><br>
                <img src="../images/1x1.gif" width="1" height="7" border="0"><br>
                <a href="tax.html" target="content">Tax</a><br>
                <img src="../images/1x1.gif" width="1" height="7" border="0"><br>
                <a href="mergers_acquisition_consulting_due_diligence.html" target="content">Mergers and Acquisition Consulting and Due Diligence</a><br>
                <img src="../images/1x1.gif" width="1" height="7" border="0"><br>
                <a href="sec_small_business_filers.html" target="content">SEC Small Business Filers</a><br>
                <img src="../images/1x1.gif" width="1" height="7" border="0"><br>
                <a href="tax_return_preparation_services.html" target="content">Tax Return Preparation Services</a><br>
                <img src="../images/1x1.gif" width="1" height="7" border="0"><br>
                <a href="controllership_start_up_services.html" target="content">Controllership and Start Up Services</a><br>
                <img src="../images/1x1.gif" width="1" height="7" border="0"><br>
                <a href="services_audit_committees_public_companies.html" target="content">Services for Audit Committees of Public Companies</a></p>
                    </td>
                    <td valign="top" width="100%">
                      <img src="../images/1x1.gif" width="1" height="10" border="0"><br>
                      <nolayer>
                      <iframe name="content" id="content" style="position:relative; width:100%; height:200" src="blank_page.html" scrolling="auto" frameborder="0"></iframe>
                      </nolayer>
                    </td>
                  </tr>
                </table>
    Gordo
    "In the End, we will remember not the words of our enemies, but the silence of our friends."
    - Martin Luther King Jr. (1929-1968)

  • #2
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    maybe i just missed it, but i didn't see any difference between those two chunks of code. but, my thought is this: use a function to just change the src and href properties. why have 2 sets of links? have one set of links, and if it's NS4, then have a function that loops through the links and images, and changes them appropriately.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    TEXAS . . . 'nuf said
    Posts
    468
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You are almost correct about the links being the same. The second set uses target="content". The second set changes the IFRAME content. That's why I need the second set of links hidden from N4.x.
    my thought is this: use a function to just change the src and href properties. why have 2 sets of links? have one set of links, and if it's NS4, then have a function that loops through the links and images, and changes them appropriately.
    That sounds just dandy to me, but I have NO clue how to do it. I don't know JS. (hangs head in shame) ... I'm just a glorified cut-n-paster. That's why I almost always request "full code replies" at the top of my queries. Anyway, I'd be glad to use something like that, but can't create it.

    Only the links change:
    1) target IFRAME for IE, N6, Opera, etc., and
    2) take over current window for N4

    The images are just there to space out the links without using a full <p></p> on every line (adds just a little too much space).

    Care to create some code for me!?

    Now, this is another issue, but I foresee having to have some main navigation links that would open the page with these links with a specific page in the IFRAME. I may have to search for that one very soon. But, I'm sure I'd have to code those links just the same -- sending N4 users directly to the respective generic page.
    Gordo
    "In the End, we will remember not the words of our enemies, but the silence of our friends."
    - Martin Luther King Jr. (1929-1968)

  • #4
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    well, let me know how this works for you:

    every link gets an onClick handler. by default, the links load in the main page. this means that no matter what, you get to see the page that's being linked to, even if you have NS4, or you don't have javascript, or god forbid, you're using Lynx. however, if the onClick handler works, then, the target attribute is switched to load the page into the IFrame.

    some sample code for that:

    <head>
    <script>
    function targetSwitch(linkObj) {
    if (!document.layers) {
    linkObj.target = "content";
    }
    }
    </script>
    </head>

    <a href="financial_audits_reviews.html" onClick="targetSwitch(this);">Financial Audits and Reviews</a>

    sound good?
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    TEXAS . . . 'nuf said
    Posts
    468
    Thanks
    0
    Thanked 0 Times in 0 Posts
    In my best Texas accent -- hot damn, that's just about it.

    Okay, I wanted to post this real quick, but I'm working on this at the same time. So, I may be able to adjust this myself (?).

    Let me if I can explain this...
    the target page (i.e. financial_audits_reviews.html) is just the basic content to be displayed in the IFRAME. When using N4.x, this target page does take over the browser (GOOD). But, it (of course) no longer contains the basic images, navigation, et al. that are part of each page -- making the site look consistent.

    Since I'm using FrontPage for this (I know it's not looked upon favorably), I am able to "include page" so that I can simply have a page such as financial_audits_reviews_n4.html wherein the basic content page of financial_audits_reviews.html is "included".

    So, what would be the best way for me to accomplish this? Can the script and/or the <a> link you last posted be adjusted to make N4 use the specific page for the browser? I'm just trying to figure out the best way to do this. I guess that's why I was initially trying to have two sets of links. At least that's my (flawed) logic.

    Appreciate it. I can feel this issue coming to an end soon...very soon.

    <EDIT>
    Hmm, perhaps adding a redirect for N4 users on the basic content pages could send them to the full page with the included basic content.
    Hmmmmmm
    </EDIT>
    Last edited by Gordo; 08-23-2002 at 05:12 AM.
    Gordo
    "In the End, we will remember not the words of our enemies, but the silence of our friends."
    - Martin Luther King Jr. (1929-1968)

  • #6
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Ever heard if conditional commenting?

    This renders only in NS4:

    <!--&{true};
    hey hey, you are using NS4!
    -->

    I use true because whatever is inside the comment only renders if the provided condition is true.
    <!--&{false};
    this will never render
    -->

    All other browsers ignore it, and DOM compliant browsers will see it as a Comment node (because that's what it is).


    IE5+ has its own version:

    <!--[if IE]>
    content rendered only by IE (only 5.0 and up support this anyway)
    <![endif]-->


    NS6 removed support for Javascript entities and conditional comments it seems, so be wary of how you use it.

  • #7
    Regular Coder
    Join Date
    Jun 2002
    Location
    TEXAS . . . 'nuf said
    Posts
    468
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Never heard of it...but that's because I don't know JS. Y'all would be surprised how little I actually know about such things -- or not.

    Anyway, how would that solve my problem. I could replace my <script language="JavaScript">
    <!--
    if (document.layers) {.........

    code with it, but the other (second set) of links would still be present (viewable to N4 users).

    Or, are you thinking of using that elsewhere? Sorry, I'm just a little confused about the how/why/where of implementing such conditional commenting.
    Gordo
    "In the End, we will remember not the words of our enemies, but the silence of our friends."
    - Martin Luther King Jr. (1929-1968)

  • #8
    Regular Coder
    Join Date
    Jun 2002
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok, drum roll for the dumb question.....

    Why not wrap the 2nd set of links in a div and hide it from NN4 using CSS?

  • #9
    Regular Coder
    Join Date
    Jun 2002
    Location
    TEXAS . . . 'nuf said
    Posts
    468
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Graeme Hackston...you're assuming I know how to do that! Hahaha! I'm feeling so...so...not smart today.

    Without diverting from these last few posts too much, let me throw in another potential issue.

    If you take a look at the ATTACHMENT in this post, you'll notice that I have 'main' navigation links on the left. Some of them will open this SERVICES page with the IFRAME targeted/populated with one of the links on the page. I haven't figured out how to do this yet, but I'm fairly certain it can be done.

    Now, with all of this special N4.x code flying around, won't that be even harder!? I'm really starting to think that I should just redirect N4 users to their own special SERVICES page.

    It's not like the content will be updated that often, so I'm not worried about having to update two pages when one little thing changes. That's obviously not a big deal. I'm thinking I may have gotten too caught up in the whole IFRAME vs what to do for N4 issue. I probably should have looked more at the big picture.

    Granted, I'm learning more and more by all of your posts, but I should really concentrate on getting this taken care of before I get any deeper. If I'm causing any of you to pull your hair out saying "why did you waste my time" -- then I sincerely apologize. You know by my 'help others' posts that I don't like it when people waste my time/efforts either.

    Anyway, please give me your thoughts on this matter. I don't care what the code behind the scenes looks like as long as it works. If everything's in place on the major browsers of my users, then I'm happy.

    Contemplating re-writing this entire post, but just going to go ahead and hit the submit button. Argh!!!
    Attached Thumbnails Attached Thumbnails Hide SOME code (html) from N4.x (best option?)-services_nav_links_etc.jpg  
    Gordo
    "In the End, we will remember not the words of our enemies, but the silence of our friends."
    - Martin Luther King Jr. (1929-1968)

  • #10
    Regular Coder
    Join Date
    Jun 2002
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Gordo, if you're interested, you can serve NN4 its own CSS using @import or browser sniffing. I believe there is already a few threads in this forum regarding browser sniffing, I don't know about @import.

    Then you just wrap the links in a div:

    <div id="my-div">
    links
    </div>

    and put this in NN4s CSS:

    #my-div {
    display: none;
    }

    or this if you want it to be hidden but still in the text stream (taking up space)

    #my-div {
    visibility: hidden;
    }

  • #11
    Regular Coder
    Join Date
    Jun 2002
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Also, if you haven't already set up separate CSS for specific browsers now might be a good time to start. It will likely save you alot of grief in the future because even with strict doctypes there are differences in the way they render pages.


  •  

    Posting Permissions

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