ID:183791
 
The problem is im trying to set up a different CSS on the different month but it doesnt work

can someone help me out i need help on this
If I recall correctly, the functions are getMonth() and getDate(), not GetMonth() and GetDate().

Hiead
In response to Hiead
tried that no luck
This isn't for your Member blog, is it? Because you can't put Javascript in your Member blog.
In response to Crispy
no its not for my members blog
In response to Upinflames
Bump
and i've retabbed it so it's easier to read i really need help

<script type="text/javascript">
var a = new Date()
var b = a.getMonth()
var e = a.getDate()

var f = csss
function CSSchoice(csss)
{
if (b == 1)
{
if (e == 1)
{
csss = Febuary.css
}
else
{
csss = Origanal.css
}
else
{
csss = Origanal.css
}
}
}
var g = csss
var txt2 = "<link href=\'"+ g +"\' rel=\'stylesheet\' type=\'text/css\'>"
document.write(txt2)
</script>

</body onLoad="CSSchoice()">
In response to Upinflames
Now that you've made the code readable, the problems are actually pretty easy to spot.

1. You've wrapped up everything in a function that is never called, just defined - and even if it was called, your use of scope is all over the place so it wouldn't do anything anyway. You don't need it to be a function. Just kill these lines:

function CSSchoice(csss)
{

And the matching closing brace as well.

Also, this line does nothing: var f = csss. Get rid of that too.

2. The names of the files need to be enclosed in double quotes, since they're strings: "February.css", "Original.css"

3. I don't think you need to escape the single quotes like that, since they're in a double-quoted string.
In response to Crispy
still no luck should it be under the body tag
In response to Upinflames
It would help if you posted the whole file so I can see what's going on properly.
In response to Crispy
<HTML>
<head>
<title>Website name-page</title>
</head>
<body>
<script type="text/javascript">
var a = new Date()
var b = a.getMonth()
var e = a.getDate()


if (b == 1)
{
if (e == 1)
{
csss = "Febuary.css"
}
else
{
csss = "Origanal.css"
}
else
{
csss = "Origanal.css"
}
}
var g = csss
var txt2 = "<link href='"+ g +"' rel='stylesheet' type='text/css'>"
document.write(txt2)
</script>




<center>
<font size="25">Website name</font size><br>
<font size="3">A slogan!</font size>
</center>

<br><br>


<center>
<a href="Another link">success</a>
</center>


<br>

<table width=20% align="LEFT">
<tr>
<td>
<center>
<a href="A link">A link</a>
</center>
</td>
</tr>
</table>

<table width=60% align="CENTER">
<tr>
<td>
<center>
<font size="6">title of content</font size><br>
<font size = "4">Details</font size><br>
Where text goes
</center>
</tr>
</td>
</table>




<br><br><br>
<center>
<script type="text/javascript">
var c = new Date()
var d = c.getUTCFullYear()
var txt = "<font size=\"1\">Copyright &copy "+ d +" Website address. All Rights Reserved</font size><br>"
document.write(txt)
</script>

</center>
</body>
</html>
In response to Upinflames
You have a closing brace in the wrong place.

Also, you don't need the g var at all. You already have csss, so just use it instead.

Fixed version:
if (b == 1)
{
if (e == 1)
{
csss = "Febuary.css"
}
else
{
csss = "Origanal.css"
}
} // added a brace here
else
{
csss = "Origanal.css"
}
// removed brace from here

var txt2 = "<link href='"+ csss +"' rel='stylesheet' type='text/css'>"
document.write(txt2)
In response to Crispy
thx crispy
In response to Upinflames
For future reference, if you view the page in Firefox there's a console that you can open (Tools -> Error console) that displays Javascript errors. That should help in cases like this one.