• 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.