here is my code

<html>
<head>

<script type="text/javascript" src="/js/prototype.js"></script>
<script type="text/javascript" src="/js/scriptaculous.js"></script>

</head>
<body>
<form name="frm" method="POST" action="">
<input  id="autocomplete" type="text" name="_field">
<input  type="hidden" name="field" value="-1">
<input  type="submit">
<div id="autocomplete_choices" class="autocomplete"></div>

<script type="text/javascript">

Event.Observe(window,'load',
        function(){
        new Ajax.Autocompleter("autocomplete", "autocomplete_choices", "./
li.php");
        }
        )

</script>
</form>

</body>
</html>

and my error is:

'Event' is undefined

if a change my code for this

new Event.Observe(window,'load', .....

now my error is

'Ajax' in undefined

i dont know why? maybe my prototype.js or scriptaculous.js are
corrupt?

On 28 ene, 07:27, disccomp <[email protected]> wrote:
> Just a guess. Maybe try waiting for the DOM to load before calling
> your function:
> new Ajax.Autocompleter("autocomplete", "autocomplete_choices", "./
> li.php", {});
>
> Like this:
> Event.Observe(window,'load',function(){
>   new Ajax.Autocompleter("autocomplete", "autocomplete_choices", "./
> li.php", {});
>
>
>
> });- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" 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/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to