By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,760 Members | 1,557 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,760 IT Pros & Developers. It's quick & easy.

Running Script on local Webserver

P: n/a
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
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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 <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_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-deve...upgrade_2.html
Jul 20 '05 #2

P: n/a

"Grant Wagner" <gw*****@agricoreunited.com> 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!
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.