SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Evangelist
    Join Date
    Jan 2001
    Location
    earth
    Posts
    501
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    why? but why this code is not working?



    Well... this code had work last year. But after my computer had problems....it didn't work anymore.

    Hello!

    This code above detects the browser and directs to INDEX.ASP
    The problem is that it doesn't go to the . ASP.

    <html>
    <head>
    <title>.</title>
    <script language=JavaScript>
    function executar ()
    {
    if (document.all)
    {
    browser="ie"
    }
    else if (document.layers)
    {
    browser="netscape"
    }
    else if (document.getElementById? 1:0)
    {

    browser="NN6"
    }
    else
    {
    browser="others"
    }
    document.cookie="Plataforma=" + window.navigator.platform;
    document.cookie="Browser=" + browser;
    document.location.href="index.asp"
    }

    </head>


    <body onLoad=executar()>

    </body>
    </html>


    WHAT'S HAPPENNING?

    On the IE the pages is grey. On the Netscape the code appears on the browser. And it doesn't go to the INDEX. ASP.



    Bye:::::::::::::::::::::::

  2. #2
    morphine for a wooden leg randem's Avatar
    Join Date
    Jun 2002
    Location
    .chicago.il.us
    Posts
    957
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You have a few errors in there, the worst of which is forgetting the closing </script> tag.

    Try this:
    Code:
    <head>
    <title>.</title>
    <script type="text/javascript">
    function executar()
    {
    	if(document.all){
    		browser = 'ie';
    	}else if(document.layers){
    		browser = 'netscape';
    	}else if(document.getElementById){
    		browser = 'NN6';
    	}else{
    		browser = 'others';
    	}
    	document.cookie = 'Plataforma=' + window.navigator.platform;
    	document.cookie = 'Browser=' + browser;
    	window.location = 'index.asp';
    }
    </script>
    </head>
    
    <body onload="executar()">
    
    </body>
    </html>
    ----Adopt-a-Sig----
    Your message here!

  3. #3
    SitePoint Evangelist
    Join Date
    Jan 2001
    Location
    earth
    Posts
    501
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I LOVE YOU!!!!!



    I've just closed the script!!! And guess?
    It works!! OH!! What a stupid girl I'm.


  4. #4
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes you are

    No sympathy here

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  5. #5
    morphine for a wooden leg randem's Avatar
    Join Date
    Jun 2002
    Location
    .chicago.il.us
    Posts
    957
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by magi
    I LOVE YOU!!!!!
    Love, you say?
    Hmmm.... That's the first time it was my brain that a gal loved.
    ----Adopt-a-Sig----
    Your message here!

  6. #6
    SitePoint Evangelist
    Join Date
    Jan 2001
    Location
    earth
    Posts
    501
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Flawless_koder
    Yes you are

    No sympathy here

    Flawless
    Merci.


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
  •