• 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' />
<script type='text/javascript' src='../jquery/jquery.js'></script>
<script type='text/javascript' src='../fullcalendar.min.js'></script>
<script type='text/javascript' src='../gcal.js'></script>
<script type='text/javascript'>

	$(document).ready(function() {
		var feed="<?php echo $value?>";

		$('#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();
				}
			}

		});

	});

</script>
<style type='text/css'>

	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;
		}

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

Link to comment
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.