MooTools problem?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
wildwobby
Forum Commoner
Posts: 66
Joined: Sat Jul 01, 2006 8:35 pm

MooTools problem?

Post by wildwobby »

I was trying out the Ajax class for mootools tried out something simple (a link with an onclick property that triggers a function that is supposed to use ajax to display a static html page). So I though the update option in the ajax class would work.

Code: Select all

function getAjax(){
	new Ajax('cont.html', {
		method: 'post',
		update: $('gmd')
	}).request();
}

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Ajax Testing</title>
<script type="text/javascript" src="mootools.js"></script>
<script type="text/javascript" src="custom.js"></script>
</head>
<body>
<div id="gmd">Page Content loaded here!</div>
<a href="replaced.php" onClick="getAjax(); return false;">get page!</a>
</body>
</html>
that is the html and the function triggered when the link is clicked. I know the AJAX part is working because firebug shows the post/get requests (I've tried both) and correct responses, but it isn't updating the div. The div's id is gmd so thats not the problem. And I'm running out of ideas...

Any help is appreciated![/syntax]
Post Reply