locked
Javascript - load page based on Username RRS feed

  • Question

  • I have 2 groups of people; group 1 of about 6 people need access to a specific internal webpage (I'll do if statements for each of them).  So when a button is clicked, I'd like group 1 to reload the original page after an alert.  Group 2 - load the new page.

    Here's what I've got so far:

    <script type="text/javascript">
    Function ldwrkPage90 (){
        var WinNetwork = new ActiveXObject("WScript.Network");
        if (WinNetwork.UserName = "membergrp2"){
            window.open("test.html");
        }
        elseif (WinNetwork.Username = "membergrp1"){
    
        alert("You do not have access to this page."); 
        location.reload(); 
    
        }
    }
    </script>
    
    
    BUTTON...onclick="ldwrkPage90()"

    It doesn't work.  I've tested the WinNetwork.UserName with an alert and it does retrieve the right name so I think I might have an issue with syntax. 

    Help!!!  I hope I'm in the right forumn.  I can't use server side code so please don't tell me to use ASP.  thx.


    Excel Worker Bee

    Tuesday, February 11, 2014 10:45 PM