4 Replies - 2398 Views - Last Post: 12 December 2012 - 06:29 PM

#1 mkjt88  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 47
  • Joined: 11-February 11

What will do this function for me.. Javascript?

Posted 10 December 2012 - 07:27 PM

Hey guys on the site here TurnerTree .. My main page I have the Garden Guide that shows the current months post.. Every month I manually update this and sometimes forget to do it on the first week of the month and want to do it automatically... Would javascript or what be the best way to get something like that auto. Also if you give me a language suggestion what parts of the language would I utilize to do this the best? Thanks in advance for any help.

Is This A Good Question/Topic? 0
  • +

Replies To: What will do this function for me.. Javascript?

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3541
  • View blog
  • Posts: 10,225
  • Joined: 08-June 10

Re: What will do this function for me.. Javascript?

Posted 11 December 2012 - 03:29 AM

for recurring tasks on the server, look into cronjob. (that automatically starts a script/app according to its settings).
Was This Post Helpful? 0
  • +
  • -

#3 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 444
  • View blog
  • Posts: 1,492
  • Joined: 28-April 09

Re: What will do this function for me.. Javascript?

Posted 11 December 2012 - 06:03 PM

It also kind of depends on where this information is at and how it's made available. When you say you're manually updating this, is this just a static page that you are copying and pasting the current month's post into each month? Is it you using a server-side programming language to pull the post from a database and you have to update something in that each month?

This post has been edited by Nakor: 11 December 2012 - 06:03 PM

Was This Post Helpful? 0
  • +
  • -

#4 mkjt88  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 47
  • Joined: 11-February 11

Re: What will do this function for me.. Javascript?

Posted 11 December 2012 - 09:11 PM

Here is the html that I update.. I just edit the index.html file and refresh it on the server. I change "almanac.html#dec" to dec jan feb or whatever the month is. I also do it at the bottom. THen I just update the message for that month there in the middle.

<span class="date"><a href = "almanac.html#dec"> &gt; &gt; December </a></span>
		<br />
		<font size="2">
			<ul>
				<li>
				<p> 
				      A garden is much more than a place you designate for growing plants. A closer look shows that your garden is home to a variety of life ranging from barely visible insects to larger animals like toads and rabbits. Observing wildlife in your garden can be entertaining and educational but can also be a problem...
				</p> 
				</li>
			</ul>	
			
			&nbsp; <span class="readMore"><a href = "almanac.html#dec">Read More...</a></span>
		</font>
		<hr>

This post has been edited by mkjt88: 11 December 2012 - 09:15 PM

Was This Post Helpful? 0
  • +
  • -

#5 Nakor  Icon User is offline

  • Professional Lurker
  • member icon

Reputation: 444
  • View blog
  • Posts: 1,492
  • Joined: 28-April 09

Re: What will do this function for me.. Javascript?

Posted 12 December 2012 - 06:29 PM

since this is just html and there's no server work going on you could use javascript to automatically update those values. You'd need to create a couple of arrays with the corresponding data and then update those elements depending on the current month. However, you could run into a problem if someone visiting your web page had javascript disabled.

This type of thing is normally handled by saving the values in a database or maybe a file on the web server and then using a server-side language to inject the values into the html. However, since you're not using a server-side language I'd probably just suggest setting a reminder in your calendar and to just keep on doing it manually until your website can be updated to use a database and server-side code.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1