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 7 of 7
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    TEXAS . . . 'nuf said
    Posts
    468
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation BROWSER REDIRECT issue -- Can you handle it!?

    "Browser Redirect Script" from DD ... in the process of modifying for my needs. I can't get the IE line to work. It's supposed to stay on the page in which I place this script, and load the iframe should it be necessary -- such as with http://www.website.com/services/inde...meservice.html -- where someservice.html will load in the iframe. I'm getting errors with the portion in bold. No, I don't "know" JavaScript. But, I follow along from time to time. I await your reply and/or solution(s). Thanks!

    <script>

    //Browser redirect Script- © Dynamic Drive (www.dynamicdrive.com)
    //For full source code, 100's more DHTML scripts, and Terms Of Use,
    //visit dynamicdrive.com

    var browser_type=navigator.appName
    var browser_version=parseInt(navigator.appVersion)

    //if NS 6
    if (browser_type=="Netscape"&&browser_version>=5)
    window.location.replace("index_n4.html")
    //if IE 4+
    else if (browser_type=="Microsoft Internet Explorer"&&browser_version>=4)
    { window.frames['content'].location = window.location.search.slice(1); }

    //if NS4+
    else if (browser_type=="Netscape"&&browser_version>=4)
    window.location.replace("index_n4.html")
    //Default goto page (NOT NS 4+ and NOT IE 4+)
    else
    window.location="http://www.dynamicdrive.com"
    </script>



    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    Below is what I started to type in this post. I thought it might be easy for one of you to add in an N6 spec in the following body onload statement. So, feel free to answer this if applicable. THANKS.
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

    I have the following browser checker to redirect N4 users to an alternalte page. How can I make N6 users go to the same page!?

    <body onload="if(document.layers){window.location='index_n4.html'} else { if (window.location.search) { window.frames['content'].location = window.location.search.slice(1); } }">

    The else part loads an iframe (if applicable). I know N6 can normally handle iframes, but not the way I'm doing it. So, I need it redirected.
    Last edited by Gordo; 12-15-2002 at 06:31 PM.
    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
    Regular Coder
    Join Date
    Jun 2002
    Location
    TEXAS . . . 'nuf said
    Posts
    468
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I hate bumping my own threads. I really do!

    But, I thought this problem wouldn't be too difficult for y'all. Just (please) take a look at the bold part above and tell me how to fix it.

    Thanks!
    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)

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    TEXAS . . . 'nuf said
    Posts
    468
    Thanks
    0
    Thanked 0 Times in 0 Posts


    Okay, I guess I've stumped all of you again. Sorry to be so pissy, but after a long day's work (stress), I really needed a nice bonus tonight.

    I guess I'll bump this last time -- so I don't get in trouble.
    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
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    you can't access an iframe (or any form element for that matter) when it is NOT LOADED yet in the page.
    Last edited by glenngv; 12-17-2002 at 03:28 AM.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    TEXAS . . . 'nuf said
    Posts
    468
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the reply glenngv...I was hoping someone like yourself might drop by.

    Okay, so how can I adapt (if at all) the <BODY> line below into a browser redirection script? The <body> line below currently works...and redirects N4 users. I need it to also redirect N6 users.

    Anything else that will simulate this...and give me the same results!?

    <body onload="if(document.layers){window.location='index_n4.html'} else { if (window.location.search) { window.frames['content'].location = window.location.search.slice(1); } }">
    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
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    if you want to redirect ns4 and ns6 to the same page:

    <body onload="if(document.layers || (document.getElementById && !document.all)){window.location='index_n4.html'} else { if (window.location.search) { window.frames['content'].location = window.location.search.slice(1); } }">


    if you want to redirect on a different page:

    <body onload="if(document.layers){window.location='index_n4.html'} else if (document.getElementById && !document.all){window.location='index_n6.html'} else { if (window.location.search) { window.frames['content'].location = window.location.search.slice(1); } }">

    you might want to put it in a function so that it's more readable
    Last edited by glenngv; 12-17-2002 at 05:16 AM.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #7
    Regular Coder
    Join Date
    Jun 2002
    Location
    TEXAS . . . 'nuf said
    Posts
    468
    Thanks
    0
    Thanked 0 Times in 0 Posts
    THANKS, glenngv!
    you might want to put it in a function so that it's more readable
    Well, I'd be happy to try out other code, but I'm unable to write it. What you've given me works! If you or anyone else wants to write something more stable, by all means post your creations. Thanks again!
    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)


  •  

    Posting Permissions

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