Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8590863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:23:34+00:00 2026-06-11T23:23:34+00:00

I have made this script that get’s the month and the year from calendar.php

  • 0

I have made this script that get’s the month and the year from calendar.php and I would like when I click the link previous month to get the previous month but also when month number reach 1 make the year – 1. How can I do something like that?

<html>
<head></head>


<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"    type="text/javascript"></script>
<script>
$(function() {
get_data();
});

function get_data(a, b) {

$.get('calendar.php', { 
    month: a, year: b
    }, 

    function(response) {
    $el = $('<div></div>').attr('class', 'data').html(response);
    $('#datas').prepend($el);
    height = $el.height()+'px';
    $el.css({'opacity': 0, 'display': 'block', 'height': '0px'}).animate({height: height }, 500, function() {
            $(this).animate({opacity: 1}, 500);
    })
});
}
   </script>
<style>
#datas {
overflow: hidden;
}
.data {
display: none;
}
</style>
<body>
 <a href="#" OnClick="get_data(9, 2012);" > Previous month</a>
<div id="datas">
</div>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:23:35+00:00Added an answer on June 11, 2026 at 11:23 pm

    I think you should use jQuery.ajax

    $.ajax({
        url: 'calendar.php',
        success: function(data) {
            // Parse your data and do all neccessery refreshing
        }
    });
    

    in order get yerstaday you can use

    var d = new Date(/* data that you get from calendar.php*/);
    d.setDate(d.getDate() - 1);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made an Ajax request to a PHP script and that PHP script
Ok, so I have this PHP script that runs in a nice little infinite
Hi I have recently made this script to rename files I scan for work
Hi have made this function which is made to replicate an error that I
i have made a simple php contact form following this tutorial: http://www.catswhocode.com/blog/how-to-create-a-built-in-contact-form-for-your-wordpress-theme The big
I have a php script that outputs json data. For the purposes of testing,
I have a script that creates files on multiple threads. Occassionally, I will get
Currently I have this small script that makes it possible to check if a
I made a shell script that get a remote file with ftp protocol, if
I have made a script that adds files to a zip (after lots of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.