Running Script on local Webserver

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

    Running Script on local Webserver

    The following script works fine on two Webservers in the internet, but it
    doesn't work on my local Webserver (Xitami). I also tried the IIS, with the
    same result - the script isn't forwarding me

    <script language="JScri pt">
    <!--
    function Kontrolle()
    {
    var WshNetwork = new ActiveXObject(" WScript.Network ");
    var vDomain = WshNetwork.User Domain;

    if(vDomain == "´TESTDOM")
    {
    location.href = "right.htm" ;
    }
    else
    {
    location.href = "wrong.htm" ;
    }
    }
    //-->
    </script>

    It must be a problem with the WScript object, but I've no clue what to do

    Christoph


  • Grant Wagner

    #2
    Re: Running Script on local Webserver

    Christoph wrote:
    [color=blue]
    > The following script works fine on two Webservers in the internet, but it
    > doesn't work on my local Webserver (Xitami). I also tried the IIS, with the
    > same result - the script isn't forwarding me
    >
    > <script language="JScri pt">
    > <!--
    > function Kontrolle()
    > {
    > var WshNetwork = new ActiveXObject(" WScript.Network ");[/color]

    This will cause a yellow ! in Internet Explorer. You can't create a
    WScript.Network object in Internet Explorer downloaded from a web server.
    Double-clicking the yellow ! will probably be something like "Automation server
    can't create object".
    [color=blue]
    > var vDomain = WshNetwork.User Domain;
    >
    > if(vDomain == "´TESTDOM")
    > {
    > location.href = "right.htm" ;
    > }
    > else
    > {
    > location.href = "wrong.htm" ;
    > }
    > }
    > //-->
    > </script>
    >
    > It must be a problem with the WScript object, but I've no clue what to do[/color]

    You can't obtain information about what domain a Windows computer is connected
    to using JavaScript running in Internet Explorer in the default security
    environment. You would have to lower your security settings to dangerous levels
    to allow the above script to run (alternatively you could add the site to your
    Trusted Sites list and lower the settings there).
    [color=blue]
    > Christoph[/color]

    --
    | Grant Wagner <gwagner@agrico reunited.com>

    * Client-side Javascript and Netscape 4 DOM Reference available at:
    *


    * Internet Explorer DOM Reference available at:
    *
    Gain technical skills through documentation and training, earn certifications and connect with the community


    * Netscape 6/7 DOM Reference available at:
    * http://www.mozilla.org/docs/dom/domref/
    * Tips for upgrading JavaScript for Netscape 6/7 and Mozilla
    * http://www.mozilla.org/docs/web-deve...upgrade_2.html


    Comment

    • Christoph

      #3
      Re: Running Script on local Webserver


      "Grant Wagner" <gwagner@agrico reunited.com> wrote:
      Christoph wrote:[color=blue]
      >[color=green]
      > > The following script works fine on two Webservers in the internet, but[/color][/color]
      it[color=blue][color=green]
      > > doesn't work on my local Webserver (Xitami). I also tried the IIS, with[/color][/color]
      the[color=blue][color=green]
      > > same result - the script isn't forwarding me
      > >
      > > <script language="JScri pt">
      > > <!--
      > > function Kontrolle()
      > > {
      > > var WshNetwork = new ActiveXObject(" WScript.Network ");[/color]
      >
      > This will cause a yellow ! in Internet Explorer. You can't create a
      > WScript.Network object in Internet Explorer downloaded from a web server.
      > Double-clicking the yellow ! will probably be something like "Automation[/color]
      server[color=blue]
      > can't create object".[/color]
      [color=blue]
      >[color=green]
      > > var vDomain = WshNetwork.User Domain;
      > >
      > > if(vDomain == "´TESTDOM")
      > > {
      > > location.href = "right.htm" ;
      > > }
      > > else
      > > {
      > > location.href = "wrong.htm" ;
      > > }
      > > }
      > > //-->
      > > </script>
      > >
      > > It must be a problem with the WScript object, but I've no clue what to[/color][/color]
      do[color=blue]
      >
      > You can't obtain information about what domain a Windows computer is[/color]
      connected[color=blue]
      > to using JavaScript running in Internet Explorer in the default security
      > environment. You would have to lower your security settings to dangerous[/color]
      levels[color=blue]
      > to allow the above script to run (alternatively you could add the site to[/color]
      your[color=blue]
      > Trusted Sites list and lower the settings there).[/color]

      Sure I can create that object! As I said, it works on 2 webservers on
      the internet, so it's just a problem with the configuration of my own
      Webserver
      The IE asks me, if I want to allow it, but it works!


      Comment

      Working...