mcerveni Posted April 5, 2009 Share Posted April 5, 2009 Anytime i put this: <script type="text/javascript"> var WshNetwork=new ActiveXObject("WScript.Network") var ca = WshNetwork.UserName; alert(ca); </script> the browser IE or firefox will give me this error: Error: ActiveXObject is not defined Source File: http://localhost/stats/index.php what I don't get is.. if I make a blank page and put that piece of javascript in the <head> section. it will work. For whatever reason, my site's i come up with once they're done - that active x code will not run lol... i neeed to figure out why. here is my header.php page .. <?php session_start(); ?> <html> <?php include('config.inc.php'); include('functions.inc.php'); ?> <head> <?php if(isset($_SESSION['logged_in'])) { ?> <title> Team Coach Center - <?php echo $_SESSION['tc_name'];?> </title> <?php } else { ?> <title> Team Coach Center </title> <?php } ?> <link rel="stylesheet" type="text/css" href="style/style.css"> <script type="text/javascript" src="scripts/func.js"> </script> <script type="text/javascript" src="scripts/mt1.1.js"> </script> </head> <body> <div id="dim"> </div> <div id="dimContent"> </div> <div id="check"> </div> Quote Link to comment Share on other sites More sharing options...
Floydian Posted April 5, 2009 Share Posted April 5, 2009 I don't know why IE is choking on it, but only IE has ActiveX. So, it's pointless to target other browsers with ActiveX... Quote Link to comment Share on other sites More sharing options...
mcerveni Posted April 6, 2009 Author Share Posted April 6, 2009 Well, it's choking on it because it's not an HTML page. When i put that script in an html page, it will work. But in my php page, the ActiveXObject is not defined.. any suggestions? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.