Running Script on local Webserver

Discussion in 'Javascript' started by Christoph, Aug 5, 2003.

  1. Christoph

    Christoph Guest

    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="JScript">
    <!--
    function Kontrolle()
    {
    var WshNetwork = new ActiveXObject("WScript.Network");
    var vDomain = WshNetwork.UserDomain;

    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
     
    Christoph, Aug 5, 2003
    #1
    1. Advertising

  2. Christoph

    Grant Wagner Guest

    Christoph wrote:

    > 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="JScript">
    > <!--
    > function Kontrolle()
    > {
    > var WshNetwork = new ActiveXObject("WScript.Network");


    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".

    > var vDomain = WshNetwork.UserDomain;
    >
    > 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


    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).

    > Christoph


    --
    | Grant Wagner <>

    * Client-side Javascript and Netscape 4 DOM Reference available at:
    *
    http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/frames.html

    * Internet Explorer DOM Reference available at:
    *
    http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_entry.asp

    * 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-developer/upgrade_2.html
     
    Grant Wagner, Aug 5, 2003
    #2
    1. Advertising

  3. Christoph

    Christoph Guest

    "Grant Wagner" <> wrote:
    Christoph wrote:
    >
    > > 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="JScript">
    > > <!--
    > > function Kontrolle()
    > > {
    > > var WshNetwork = new ActiveXObject("WScript.Network");

    >
    > 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".


    >
    > > var vDomain = WshNetwork.UserDomain;
    > >
    > > 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
    >
    > 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).


    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!
     
    Christoph, Aug 6, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    8
    Views:
    9,080
    =?Utf-8?B?QWRhbSBHZXRjaGVsbA==?=
    Oct 11, 2004
  2. =?Utf-8?B?WVNVVA==?=

    Access local port or Running local exe file

    =?Utf-8?B?WVNVVA==?=, Jan 14, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    527
    =?Utf-8?B?WVNVVA==?=
    Jan 14, 2006
  3. Chad Dressler
    Replies:
    0
    Views:
    653
    Chad Dressler
    Dec 30, 2006
  4. =?Utf-8?B?RGF2ZQ==?=

    How to change local webserver in VS2005?

    =?Utf-8?B?RGF2ZQ==?=, Mar 23, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    342
    Alexey Smirnov
    Mar 23, 2007
  5. K Viltersten
    Replies:
    7
    Views:
    488
    K Viltersten
    Apr 22, 2008
Loading...

Share This Page