Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I'm trying to include a piece of code via SSI but it's messing up

Status
Not open for further replies.

fpl9250

Programmer
Jan 22, 2007
46
US
I have this page that is working correctly, it has an SSI already and right above that include I'm putting the code below via include as well and it's messing up the page. What's wrong with this code? When I preview it by itself it works great, but when I put it as part of the page or via SSI it does not display at all. The code simply displays the current month and year.

Code:
<SCRIPT language="JavaScript" TYPE="text/javascript">
<!--
// Set varible to the current date
var right_now=new Date();

// set variable to current month number (0-11)
var month_num = right_now.getMonth()

// set varible to the current day value (1-31)
var thedate=right_now.getDate()

// create an array for the month name
var month_name = new Array (
"January ",
"February ",
"March ",
"April ",
"May ",
"June ",
"July ",
"August ",
"September ",
"October ",
"November ",
"December ");

// Create a varible right_year with the current year
var right_year=right_now.getYear();
document.write("<b>");
document.write(month_name[month_num]);
document.write(right_year);
document.write("</b>");
</script>
 
I'm I supposed to put this in the head of the document or something?
 
You're missing the ending comment symbol (" -->") right before the </script>.

Code:
<SCRIPT language="JavaScript" TYPE="text/javascript">
<!--
.
.
.
 [b][red]-->[/red][/b]
</script>

Mike Krausnick
Dublin, California
 
Amazing, how some times I don't look at the little things that make all the difference.

Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top