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 6037147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:01:51+00:00 2026-05-23T06:01:51+00:00

$(document).ready(function() { redo(1); $(select).change(function () { var str = ; $(select option:selected).each(function () {

  • 0
$(document).ready(function() {
    redo(1);

    $("select").change(function () {
        var str = "";
        $("select option:selected").each(function () {
            str = $(this).val() + " ";
        });
        console.log(str);
        redo(str);
    }); 

    // page is now ready, initialize the calendar...

    function redo(t) {
        $.getJSON("getPrenotazioni.php",{action:"date","cameraid":t}, function(data){
            $('#calendar').html("");
            console.log(data);

            $('#calendar').fullCalendar( 'rerenderEvents' );
            $('#calendar').fullCalendar({
                editable: false, 
                events: data,
                color: 'yellow',   // a non-ajax option
                textColor: 'black' // a non-ajax option
            });
        });

        $('#calendar').fullCalendar( 'refetchEvents' );
    }
});

And the PHP code is:

<?php
$d = getVids($db,'ji_prenotazione','da_data,a_data','WHERE cameraid='.$_GET['cameraid']);

switch ($_GET['action'])
{
    case 'date':
        if (count($d)>0) {
            for($i=0;$i<count($d);$i++)
            {
                $str[] = array('title' => utf8_encode('xxx'),'start'=>$d[$i]['da_data']."T08:30",'end'=>$d[$i]['a_data']."T08:30");
            }
        }
        else
            $str[] = array('title' => '','start'=>'','end'=>'');

        $json = array('events'=>($str));
        break;
    }
    echo json_encode($json);
?>

It seems to work but if I change something into the database, for example, if I delete all entries and refresh the webpage, the previous values are still there in the calendar.

What am I missing?

  • 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-05-23T06:01:52+00:00Added an answer on May 23, 2026 at 6:01 am

    The reason I asked what browser you are using is because all browsers behave different when executing AJaX requests. Basically a browser listens to several ‘headers’ inside a request response. One of these ‘headers’ sets the expiration date for the data downloaded, which you don’t set (assuming this is the complete code). If you keep requesting data over the same URL, you will get the ‘cached’ result instead of the new result.

    Forcing the browser to request new data every time can be done through PHP, using the header() function. Note that this function has to be called before any output is sent to the browser. The headers you have to include are like this:

    header("Cache-Control: no-cache, must-revalidate");
    header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
    

    The first header will (obviously) tell the browser to revalidate the content on every request, the second will invalidate the cache immediately (which is used in older browsers).

    Another option to do this, using Javascript instead of PHP, is to alter the URL on every request. This is not the best option, since it will create new cache data on every reload of the page, but it will work. You can do this by adding some random URL data (like "getPrenotazioni.php?id=" + Math.random()).

    Note that I am far from sure that this is your problem, but it is likely considering your code you provided. You can simply check this by opening the page in IE (or any other browser that you had already open) after you made a change and see if the pages differ amongst browsers. Alternatively you can load the page after you made change and if nothing changed, clear your cache and reload (CTRL + F5).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$(document).ready(function() { $('#<%=ddlContinents.ClientID %>').change(function() { var element = $(this); var totalLength = element.children().length; if
$(document).ready(function () { $(href).attr('href', 'title'); }); $('a[href$=.jpg]').each(function () { var imageSrc = $(this).attr('href'); var
I have the following script: $(document).ready(function() { $('#slideSelect').change(function(){ $('#slideViewer img').attr('src', $(this).val() + '.png'); });
jQuery(document).ready(function(){ $(function() { $('.button-a').each(function() { $(this).hover( function () { $('.button-title', this).animate({ opacity: 0.6 },
jQuery(document).ready(function(){ var panelContainer = jQuery('div#panels'); jQuery('<div id=tabs></div>').insertBefore(panelContainer); panelContainer.find('div.panel').each(function(n){ jQuery('div#tabs').append('<a class=tab href=#' + (n+1) +
$(document).ready(function() { for (var i=0; i<20; i++) { document.write('hello world'); } }); in this
$(document).ready(function(){ $('.choices a img').click(function(e) { var url = $(this).attr('href') + ' .con_cen2'; $('.con_cen').html('loading...').load('signup.html'); e.preventDefault();
My code $(document).ready(function(){ $(.CheckBoxClass).change(function(){ if($(this).is(:checked)){ $(this).next(label).addClass(LabelSelected); }else{ $(this).next(label).removeClass(LabelSelected); } }); }); This is my
$(document).ready(function() { $(span.link).mouseover(function(e){ $(this.children).css(display,inline); }); }); I'm not a javascript expert, but I've cobbled
Jquery has a great language construct that looks like this: $(document).ready(function() { $(a).click(function() {

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.