• 0

AJAX and jQuery Help Needed


Question

I have the following code which changes based on which calendar is selected, but the page has to be refreshed for it to happen. I wanted to use some AJAX and jQuery to reload the page without a refresh. I would be more then happy if someone could point me the in the right direction.

<?

if($_GET['calSelect']=='year7') {
	$value = "http://www.google.com/calendar/feeds/5qo4qu0qa4sc838qj55q625a10%40group.calendar.google.com/public/basic";
	}
	else {

	$value = "http://www.google.com/calendar/feeds/p5ed6hmabu5h2r80ktnarhnh7s%40group.calendar.google.com/public/basic";
	}
	echo $_GET['calSelect'];
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">;html>
<head>
<link rel='stylesheet' type='text/css' href='../fullcalendar.css' />
&lt;script type='text/javascript' src='../jquery/jquery.js'></script>t;script type='text/javascript' src='../fullcalendar.min.js'></script>t;script type='text/javascript' src='../gcal.js'></script>t;script type='text/javascript'&gt;

	$(document).ready(function() {
		var feed="&lt;?php echo $value?&gt;";

		$('#calendar').fullCalendar({

			// US Holidays

			events: $.fullCalendar.gcalFeed(feed),

			eventClick: function(event) {
				// opens events in a popup window
				window.open(event.url, 'gcalevent', 'width=700,height=600');
				return false;
			},

			loading: function(bool) {
				if (bool) {
					$('#loading').show();
				}else{
					$('#loading').hide();
				}
			}

		});

	});

&lt;/script&gt;
&lt;style type='text/css'&gt;

	body {
		margin-top: 40px;
		text-align: center;
		font-size: 14px;
		font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
		}

	#loading {
		position: absolute;
		top: 5px;
		right: 5px;
		}

	#calendar {
		width: 900px;
		margin: 0 auto;
		}

&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id='loading' style='display:none'&gt;loading...&lt;/div&gt;
&lt;div id='calendar'&gt;&lt;/div&gt;
&lt;form name="cal" action="process.php" method="GET"&gt;
&lt;select name="calSelect"&gt;
&lt;option value="year7"&gt;Year 7&lt;/option&gt;
&lt;option value="year8"&gt;Year 8&lt;/option&gt;
&lt;/select&gt;
&lt;input type=submit value="Submit"&gt;&lt;/input&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;

Link to comment
https://www.neowin.net/forum/topic/959230-ajax-and-jquery-help-needed/
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • I'd say "no thank you" to Recall. Let's turn it off as quicly as possible when installed. And Microsoft -please- don't let a "bug" re-install/re-configure it again.
    • Let's just wait until Patch Tuesday and have most of the bugs on this KB/download be taken care of & ironed out.
    • Just read that before coming here. So sad 😪 Always been one of my all time favorites whether with Sabbath or solo Glad he got the chance to do his 1 last show. Truly going home now.  
    • It comes just weeks after the Black Sabbath star took to the stage one final time with his band mates at Villa Park in Birmingham. He died "surrounded by love", a statement from his family said on Tuesday night. The family said: "It is with more sadness than mere words can convey that we have to report that our beloved Ozzy Osbourne has passed away this morning. "He was with his family and surrounded by love. We ask everyone to respect our family privacy at this time. "Sharon, Jack, Kelly, Aimee and Louis."     https://www.thesun.co.uk/tvandshowbiz/23619758/ozzy-osbourne-dead-black-sabbath-parkinsons/
    • I hard disagree on Edge being great. I actually spent a lot of time on Internet Explorer, even in the days when IE was basically a dead system and most had already switched to Chrome. I kept using IE because I was basically a Microsoft-fan-boy back then. When I first started using Windows 10, I of course started using Edge. Some things were a lot more responsive, but it had so many issues it basically was unusable. I think it's a pretty big condemnation when someone who was fine using IE11 says that Edge is what finally drove me to start using Chrome. Yes, Edge did get better over its few years before it was replaced, but it had already failed in the minds of most users.
  • Recent Achievements

    • Week One Done
      SmileWorks Dental earned a badge
      Week One Done
    • Community Regular
      vZeroG went up a rank
      Community Regular
    • Collaborator
      Snake Doc earned a badge
      Collaborator
    • Week One Done
      Snake Doc earned a badge
      Week One Done
    • One Month Later
      Johnny Mrkvička earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      586
    2. 2
      Michael Scrip
      197
    3. 3
      ATLien_0
      196
    4. 4
      +FloatingFatMan
      131
    5. 5
      Xenon
      122
  • Tell a friend

    Love Neowin? Tell a friend!