reffer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alain Dhaene

    reffer

    HI,

    Is it possible to get the name of the current page in a browser?

    Alain


  • L-and-F

    #2
    Re: reffer

    It depends on what you mean by the name, but this script will give you the
    full path and URL





    <html>
    <!-- www.lee-mcgeorge.co.uk-->
    <head>

    </head>
    <body>

    <SCRIPT LANGUAGE="JavaS cript">
    var path = "";
    var href = document.locati on.href;
    var s = href.split("/");
    for (var i=2;i<(s.length-1);i++) {
    path+="<A
    HREF=\""+href.s ubstring(0,href .indexOf("/"+s[i])+s[i].length+1)+"/\">"+s[i]+
    "</A> / ";
    }
    i=s.length-1;
    path+="<A
    HREF=\""+href.s ubstring(0,href .indexOf(s[i])+s[i].length)+"\">"+ s[i]+"</A>";
    var url = window.location .protocol + "//" + path;
    document.writel n(url);
    </script>

    </body>
    </html>






    "Alain Dhaene" <alain.dhaene@w orldonline.be> wrote in message
    news:c5h0c7$pom $1@news.worldon line.be...[color=blue]
    > HI,
    >
    > Is it possible to get the name of the current page in a browser?
    >
    > Alain
    >
    >[/color]


    Comment

    • Richard Cornford

      #3
      Re: reffer

      Alain Dhaene wrote:[color=blue]
      > Is it possible to get the name of the current page in a browser?[/color]

      Yes, look at the properties of the - location - object.

      Richard.


      Comment

      • G Roydor

        #4
        Re: reffer

        les propriétés de location sont

        location.[ hash | host | hostname | href | pathname | port | protocol |
        search ]

        GR

        Alain Dhaene a écrit:[color=blue]
        > HI,
        >
        > Is it possible to get the name of the current page in a browser?
        >
        > Alain
        >
        >[/color]

        Comment

        Working...