toxic27
08-22-2008, 02:09 AM
I have a set of JavaScript countdowns (counting down to different release dates) that I want users to be able to copy and paste a code into there profile (MySpace or whatever) and it will show up. Only problem is that some of the code is in the <HEAD> section and the other half is in the <BODY> section. When I copy both halves and put them together to test them out, it just shows code. Here's the code..
In the <HEAD> section..
<SCRIPT LANGUAGE="JavaScript">
<!--- Hide from non-JavaScript browsers
function LBP(CurrentDay) {
var XYear=CurrentDay.getFullYear();
var XDay=new Date("October, 29, 2008");
XDay.setFullYear(XYear);
var DayCount=(XDay-CurrentDay)/(1000*60*60*2...
DayCount=Math.round(DayCount);
return DayCount;}
function MonthTxt (MonthNumber) {
var Month=new Array();
Month[1]="January";
Month[2]="February";
Month[3]="March";
Month[4]="April";
Month[5]="May";
Month[6]="June";
Month[7]="July";
Month[8]="August";
Month[9]="September";
Month[10]="October";
Month[11]="November";
Month[12]="December";
return Month[MonthNumber]; }
//Stop Hiding --->
</SCRIPT>
In the <BODY> section..
<center><h5 style="position: relative; bottom: -35pt; z-index: 2"><font color="blue">
<script language="JavaScript">
<!---Hide from non-JavaScript Browsers
var Today=new Date();
var ThisDay=Today.getDate();
var ThisMonth=Today.getMonth()+1;
var ThisYear=Today.getFullYear();
var DaysLeft=LBP(Today);
var MonthName=MonthTxt(ThisMonth);
<!-- document.write("Today is "+MonthName+" "+ThisDay+"<br>"); -->
if(DaysLeft > 0) {
document.write(""+DaysLeft+" days until LittleBigPlanet!");
} else {
document.write("LittleBigPlanet is out!");
}
//Stop hiding --->
</script>
</font></h5></center>
How can I make a working embed code so people can copy & paste it into there profile and forum signatures? Thanks!
In the <HEAD> section..
<SCRIPT LANGUAGE="JavaScript">
<!--- Hide from non-JavaScript browsers
function LBP(CurrentDay) {
var XYear=CurrentDay.getFullYear();
var XDay=new Date("October, 29, 2008");
XDay.setFullYear(XYear);
var DayCount=(XDay-CurrentDay)/(1000*60*60*2...
DayCount=Math.round(DayCount);
return DayCount;}
function MonthTxt (MonthNumber) {
var Month=new Array();
Month[1]="January";
Month[2]="February";
Month[3]="March";
Month[4]="April";
Month[5]="May";
Month[6]="June";
Month[7]="July";
Month[8]="August";
Month[9]="September";
Month[10]="October";
Month[11]="November";
Month[12]="December";
return Month[MonthNumber]; }
//Stop Hiding --->
</SCRIPT>
In the <BODY> section..
<center><h5 style="position: relative; bottom: -35pt; z-index: 2"><font color="blue">
<script language="JavaScript">
<!---Hide from non-JavaScript Browsers
var Today=new Date();
var ThisDay=Today.getDate();
var ThisMonth=Today.getMonth()+1;
var ThisYear=Today.getFullYear();
var DaysLeft=LBP(Today);
var MonthName=MonthTxt(ThisMonth);
<!-- document.write("Today is "+MonthName+" "+ThisDay+"<br>"); -->
if(DaysLeft > 0) {
document.write(""+DaysLeft+" days until LittleBigPlanet!");
} else {
document.write("LittleBigPlanet is out!");
}
//Stop hiding --->
</script>
</font></h5></center>
How can I make a working embed code so people can copy & paste it into there profile and forum signatures? Thanks!