I have a header file called (*gasp*) header.js which gets included in ALL my pages (asp and plain htm).
This header file checks some variables and if appropriate it then outputs the needed html strings.
Here are the variables"
I'll skip the showsearch code because its too long but next is the showdate code and this works just fine!
Next is the code to show the users name if they are logged in:
Lastly here are the .css definitions for both the date and the login:
For the life of me I can't figure out why the date will display and the logged in user name will not! (And yes, I am logged in when I test this! <g>)
Anyone have any ideas?
Thanks,
Phil
This header file checks some variables and if appropriate it then outputs the needed html strings.
Here are the variables"
Code:
var showdate = "yes" // SHOW DATE AT THE TOP
var showsearch = "yes" // SHOW THE SEARCH FORM
var searchtext = "Search:" // TEXT FOR SEARCH FORM
var showlogin = "yes" // SHOW THE LOGGED IN USERS NAME
var logintext = "Logged in as: "
I'll skip the showsearch code because its too long but next is the showdate code and this works just fine!
Code:
// START DATE SCRIPT
if (showdate == "yes") {
document.write('<div id="date-location">');
var d=new Date()
var weekday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
document.write("<span class=\"date-font\"><nobr>" + weekday[d.getDay()] + " ")
document.write(d.getDate() + ". ")
document.write(monthname[d.getMonth()] + " ")
document.write(d.getFullYear())
document.write("</nobr><br></span>")
document.write('</div>');
}
Next is the code to show the users name if they are logged in:
Code:
// START LOGIN SCRIPT
if(showlogin == "yes") {
var strFirst = Session("first");
var strLast = Session("last");
document.write('<div id="login-location">');
if(strFirst != "")
{
document.write('<span class=\"date-font\"><nobr>' );
document.write(logintext + strFirst +" " +strLast);
document.write('</nobr><br></span>');
}
document.write('</div>');
}
Lastly here are the .css definitions for both the date and the login:
Code:
.date-font { color: #000000; font: 10px verdana, arial, sans-serif; font-weight: normal }
#date-location { left: 5px; POSITION: absolute; TOP: 4px }
.login-font { color: #339900; font: 10px verdana, arial, sans-serif; font-weight: normal }
#login-location { left: 250px; POSITION: absolute; TOP: 4px }
For the life of me I can't figure out why the date will display and the logged in user name will not! (And yes, I am logged in when I test this! <g>)
Anyone have any ideas?
Thanks,
Phil