Nathan, what can I say, perfect. Thanks a lot.  Think I understand it, Do
years automatically increment / decrease with +newYear -newYear like months
so you could have something like

$("button#prevMonth").click(function() {
loadMonth(--currentMonth),loadYear(--currentYear); });


Nathan Klatt-2 wrote:
> 
> On Tue, Jan 19, 2010 at 1:45 PM, parot <russ...@parotkefalonia.com> wrote:
>> I want to scroll back and forward through the months on a calendar
>> without
>> refreshing the page. I have the php calendar, but I don't want any page
>> refresh which I can do with PHP and just send the GET to the page.  so
>> ideally what I need is 2 links back and forward with the month variable
>> i.e.
>> 1-12 (Jan - Dec) passed to JQury/Ajax. I have been looking at a number of
>> scripts, but all to far complex (i.e. do more than I need) just I cant
>> fathom out how to pass Back (Jan go to Dec) or Forward (Jan go to Feb)
>> and
>> so on. just need 1 month at a time, nothing fancy etc.
> 
> How's about something like this?
> 
> <button id="prevMonth">Previous month</button>
> <div id="calendar"></div>
> <button id="nextMonth">Next month</button>
> 
> <script type="text/javascript">
> var currentMonth = 1;
> function loadMonth(newMonth) {
>    $("#calendar").load("getCalendar.php?m="+newMonth);
> }
> $().ready(function() {
>    loadMonth(currentMonth);
>    $("button#prevMonth").click(function() { loadMonth(--currentMonth); });
>    $("button#nextMonth").click(function() { loadMonth(++currentMonth); });
> });
> </script>
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Simplae-JQuery-Ajax-question---GET-variables-tp27229104s27240p27232199.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to