Hi all,
First post and most definietly wont be the last as Im trying to learn a bit of html with javascript. I have a script which displays the current user accessing the page. What I am trying to do is have a file containing all my js code and then display the necessary's on my html page.
This is a snippet of my index.html
As I understand it the code at the bottomCode:<body> <div id="page-container"> <div id="main-nav"> <dl class="hidden"> <dt id="about"><a href="#">About</a></dt> <dt id="services"><a href="#">Services</a></dt> <dt id="portfolio"><a href="#">Portfolio</a></dt> <dt id="contact"><a href="#">Contact Us</a></dt> </dl> </div> <div id="header"> <h1><img src="images/headers/Logo.gif" width=276" height=182" alt="Test" border="0" /></h1> </div> <div id="sidebar-a"> </div> <div id="content"> </div> <div id="footer"> <div id="altnav"> <a href="#">Home</a> - <a href="#">Home 1</a> - <a href="#">Home 2</a> - <a href="#">Contact</a> - </div> </div> <span id="username"></span> <script type="text/javascript" src="scripts/script.js"></script> </body> </html>
points to my javascript code which is here:Code:<script type="text/javascript" src="scripts/script.js"></script>
And should display the logged in user here:Code:<script type="text/javascript" language="javascript"> var objUserInfo = new ActiveXObject("WScript.network"); document.getElementById('username').innerHTML = objUserInfo.Username; </script>
But its currently blank - any ideas please?Code:<span id="username"></span>


Reply With Quote
Bookmarks