hey guys..
im a prototype rookie here..
the concept of "a framework for javascript" seemed mouth watering..
but my rails got stuck when i started using it.
here is the guinea pig im using to experiment on prototype.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/
>
<script type="text/javascript" src="prototype.js"></script>
<script language = "javascript">
function init()
{
document.getElementById('greeting-submit').style.display =
'none';
}
function greet()
{
var url = 'greeting.php';
var pars = 'greeting-
name='+escape(document.getElementById('greeting-name').value);
alert(pars);
var target = 'greeting';
var myAjax = new Ajax.Updater(target, url, {method: 'get',
parameters: pars});
}
</script>
</head>
<body onload = "init()">
<form method="get" action="greeting.php" id="greeting-form">
<div>
<label for="greeting-name">Enter your name:</label>
<input id="greeting-name" name="greeting-name" type="text"
onkeyup="greet()"/>
<input id="greeting-submit" name="greeting-submit"
type="submit" value="Greet me!" />
</div>
<div id="greeting"></div>
</form>
</body>
</html>
the php file is noting but a simple "hello world " type file that
shall display the characters u enter in the input text.
but my prototype refuses to work..
the error i am getting is:
'Ajax' is undefined.
can anyone help me as where am i going wrong!!!!!!!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---