SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2001
    Location
    Saginaw, MI
    Posts
    80
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    infinite loop problem with browser redirect scripts

    hello all!

    I've been looking for a good browser redirect script to sort-of solve the problems I'm having with Nav5+ (see thread called "css and browser problems"). All the scripts i've found only cause an infinite loop problem. I'm not sure what I might be doing wrong. Does anyone have any suggests or know of a good script that they have used and are happy with the results?

    Any advice is greatly appreciated..

    here is the last script that i tried, but didn't work:

    <SCRIPT language="JavaScript">
    <!--
    browserName=navigator.appName;

    if ((browserName=="Netscape") || (browserName=="Microsoft Internet Explorer"))
    {
    if (browserName=="Netscape")
    version="NS";
    else
    version="IE";
    }
    else
    version="OTHER";

    if ((version=="NS") || (version=="IE"))
    {
    if (version=="NS")
    /* NS URL */
    window.location="http://www.cmtonline.com/index.html";
    else
    /* IE URL */
    window.location="http://www.cmtonline.com/index1.html";
    }
    else
    /* OTHER URL */
    window.location="http://www.cmtonline.com/";

    //-->
    </SCRIPT>

    ** index.html is the old company page that still uses tables (is really slow) and index1.html is the page I have been working with that uses css (loads much faster)**

  2. #2
    SitePoint Zealot
    Join Date
    Oct 2001
    Location
    Dallas/Ft. Worth
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    re: infinite loop

    Infinite loops only happen if you have for, while, do-while statments. You don't have those in your script (which can be cleaned up a bit) so you should not have a infinite loop because of your script. However, sometimes browser can have an issues with CSS file especially if it cannot find the file itself. Make sure you're using the correct path and name of the file.

    Good luck!


Bookmarks

Posting Permissions

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