Can anyone tell me what is wrong with the function below, when I try to use the function (many different times in the same script) where d, m and y are sometimes used for different things it doesn't work. If I wanted to use it I would put something like:
if(a==2){dd(date,month,year);}
where date, month and year are specified just before I use the function.
function dd(d,m,y){while(d<1){
if(m==1 || m==2 || m==4 || m==6 || m==8 || m==9 || m==11){d+=31;}
else if(m==5 || m==7 || m==10 || m==12){d+=30;}
else if(m==3 && (y/4)==(Math.round(y/4))){d+=29;}
else{d+=28;}
m-=1;
if(m<1){m=12;y-=1;}}}
What I've had to do is to take out the d,m,y from the brackets and put this to run the function:
if(a==2){
d=date;m=month;y=year;
dd();
date=d;month=m;year=y;}
which does work but why doesn't the other method work.
If you would like to look at the full source (which I don't recommend because it's 10Kb) you'll find it at
(the add. in my signature) + /everything.js
and it has two accompanying sources at
+ /cjdump.js and + /djdump.js
which are just really big functions that contain a lot of jokes that I wanted in separate files.
I can't understand why it isn't working when I have other functions that have two different whatchamecallit's in the brackets that work fine.
Also on a less important note, if you go to this page on my site
<!-- m --><a class="postlink" href="http://www.geocities.com/prejudiced_against_everyone/pjpage.html?joketype=clean&pagenumber=8&pdate=03&pmonth=11&pyear=02&pjname=28/10/02%20-%2003/11/02">http://www.geocities.com/prejudiced_aga ... 2003/11/02</a><!-- m -->
take a look at the source and almost at the end of the line in the second script tag you'll see that it runs a function dispjokes();, I wanted this to be set to run when the pagenumber==2 || pagenumber==8 but for some reason when I put this on the end of everything.js when everything has been declared it just doesn't work and funny things start to happen like, all of the script not working.
If you know the answers to either of these questions then please tell me.
Also, I've just noticed that when you click on the link to a page on my site above why is it that there are no jokes on the page even though the address you're being linked to was copied and pasted into the message window straight from the address bar.
if(a==2){dd(date,month,year);}
where date, month and year are specified just before I use the function.
function dd(d,m,y){while(d<1){
if(m==1 || m==2 || m==4 || m==6 || m==8 || m==9 || m==11){d+=31;}
else if(m==5 || m==7 || m==10 || m==12){d+=30;}
else if(m==3 && (y/4)==(Math.round(y/4))){d+=29;}
else{d+=28;}
m-=1;
if(m<1){m=12;y-=1;}}}
What I've had to do is to take out the d,m,y from the brackets and put this to run the function:
if(a==2){
d=date;m=month;y=year;
dd();
date=d;month=m;year=y;}
which does work but why doesn't the other method work.
If you would like to look at the full source (which I don't recommend because it's 10Kb) you'll find it at
(the add. in my signature) + /everything.js
and it has two accompanying sources at
+ /cjdump.js and + /djdump.js
which are just really big functions that contain a lot of jokes that I wanted in separate files.
I can't understand why it isn't working when I have other functions that have two different whatchamecallit's in the brackets that work fine.
Also on a less important note, if you go to this page on my site
<!-- m --><a class="postlink" href="http://www.geocities.com/prejudiced_against_everyone/pjpage.html?joketype=clean&pagenumber=8&pdate=03&pmonth=11&pyear=02&pjname=28/10/02%20-%2003/11/02">http://www.geocities.com/prejudiced_aga ... 2003/11/02</a><!-- m -->
take a look at the source and almost at the end of the line in the second script tag you'll see that it runs a function dispjokes();, I wanted this to be set to run when the pagenumber==2 || pagenumber==8 but for some reason when I put this on the end of everything.js when everything has been declared it just doesn't work and funny things start to happen like, all of the script not working.
If you know the answers to either of these questions then please tell me.
Also, I've just noticed that when you click on the link to a page on my site above why is it that there are no jokes on the page even though the address you're being linked to was copied and pasted into the message window straight from the address bar.