>
> Here is the page being called . . .
> <script type="text/javascript">
> sayHi = function(){
> alert ('Hi');
> };
> </script>
> <input type="button" value="Click Me" onclick="sayHi()"/>
> My problem is that if I replace *alert* with *document.write* then the
> page gets replaced with a new page. I thought the idea behind AJAX.Updater
> was to replace the DIV with new data, or in this case the result of the
> function. *So in my newbie logic the DIV should get replaced with the
> text generated by document.write.? *
>
You cannot use document.write() after your initial page is finished loading
(in other words you cannot use document.write in fragments requested via
AJAX). You should use DOM manipulation methods like Element#insert() or
Element#update().
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/prototype-scriptaculous/-/wZ5b8XOL4cwJ.
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.