473,394 Members | 1,658 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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="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
2 5300
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

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: FLOTServer | last post by:
Here's my problem: I run a gameserver that runs the game "Medal of Honor". On the game server is log file which contains all of the data from the players for that day (kills, deaths, etc...). I...
10
by: Tobias Nilsson | last post by:
I have almost exactly the same problem as the guy below. Is it NOT possible running .NET code locally in Internet Explorer WITHOUT a webserver???? / Tobias --------- My company has in the...
9
by: Marina Anufreichik | last post by:
Hi, After deploymnet web application on web server I can access page on local machine and login fine but when I'm trying to access web site from remote machine I can see login page, but when I'm...
4
by: Øyvind Isaksen | last post by:
Hello! I'm really confused now, I need to schedule a ASP script on my webserver (win2k3) once a day but nothing works. First I tried to use the AT commant like this: at 07:00...
17
by: Csaba Gabor | last post by:
Is there a way to determine the path to the php executable (as opposed to the script. In other words, I am looking for the path to php.exe or php-win.exe) that is currently running (ie. how was...
5
by: ljlevend2 | last post by:
Is there any way to create a local server during runtime? For example, if you add an existing Web Site to a Solution from within Visual Studio (by right clicking the solution in the Solution...
8
by: geert | last post by:
Hi all, I have a mac mini running maocosx 10.5 leopard I want to deploy a django project on. My backend is MySQL, and I have it running as a 64- bit app. Of course, apache2 is also running as...
9
by: Franz Marksteiner | last post by:
Hi NG! I am using a couple of local scripts without webserver. Is there a way to make the script open a filebrowse prompt, so that the user can select some file as input? -- Freundliche...
1
by: mpc | last post by:
hello, how does one run a PHP page with a python webserver? Lets say i have a simple python web server running /path/webserver.py #!/usr/bin/env python from BaseHTTPServer import HTTPServer...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.