Log in

View Full Version : looking for a javascript ajax to handel 366 days



molina2000
12-08-2013, 05:36 PM
I have a website where I display a devotional each day of the year. I make a html file for each day of every month, and daily copy & paste the right day to my index.html file. I'm looking for a javascript ajax that can load a different file every day of the year, 366 days, not 31 days.

Is it possible to use your script title "Daily Iframe Content II" and expand 'daycontent [31] until daycontent [366]?

And can I change the name of the file to be load, instead of "1.html" so something more meaningful to me like the date of the year, because I won't be able to know which day is "249.html". The way that I name is something like this: "05-23-2013-i_need_god's_grace.html" It is long, but I need a way to handle 366 different files every single year, and I have 5 years doing it the hard way. It 's time due to learn javascript and ajax!!!

Please, if anyone of you can help me, will be appreciated.

Molina Ossers.

Deadweight
12-09-2013, 12:12 AM
So are you looking for something to load an html file for 366 days eg: Jan 1 = day 1, Jan 10 = day 10, etc...
Or do you want it to do something like this:
jan 1 = 01/01?

molina2000
12-09-2013, 01:33 AM
I would prefer
day 1 = Jan 1
day 2 = Jan 2
day 3 = Jan 3

But this present the problem of the leap year! I think.

What about:

day 1 = 'a_real_title' base on the content of the devotional?

The real matter is that I'm looking for something that can load a file to my index.html in an iframe or without an iframe. I prefer without iframe.

This is the website I'm talking about: http://www.upavision.com/English/Englishindex.html

Deadweight
12-09-2013, 02:07 PM
there would be a much more easy way to do this you know that right?

djr33
12-09-2013, 10:00 PM
Crazykld69, your post is borderline flaming and not helpful. If there is a better option, please suggest it or if not don't complain about it.

molina2000
12-09-2013, 10:14 PM
Thanks djr33, your respond brought my trust in this forum for help back. I'm just asking for help.

molina2000
04-03-2014, 03:31 PM
I'm still looking for a JS or something else to upload the devotional. Any idea?

vwphillips
04-04-2014, 10:12 AM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title></title>
</head>

<body>
<script type="text/javascript">
/*<![CDATA[*/
function Days(){
var n=new Date(),y=n.getFullYear(),m=n.getMonth(),days=n.getDate(),z0=0;
for (;z0<m;z0++){
days+=new Date(y,z0+1,1,-1).getDate();
}
return (days<10?'00':days<100?'0':'')+days;
}

alert(Days()+'.htm');

/*]]>*/
</script>
</body>

</html>