This seems to be similar to the problem I was having -- your test2
function is defined in a different scope when the script is evaled.
see: http://www.sergiopereira.com/articles/prototype.js.html, the end
of the section labeled: "Using the Ajax.Updater class"
try
<script type="text/javascript" >
test2 = function(){
document.getElementById('button').innerHTML = 'TEST3';
}
</script>
On Feb 23, 4:52 am, "Mahes" <[EMAIL PROTECTED]> wrote:
> Thx
>
> I tried this the Ajax.Updater solution.
> It works partially,
>
> The function test2 defined in the loaded page does not work!
> When I click the loaded butten I get the error: test2 is not
> defined.
>
> I still must be doing something wrong.
>
> On 22 feb, 20:21, "wiggles" <[EMAIL PROTECTED]> wrote:
>
> > instead of all that Ajax.Request stuff just do this:
>
> > function btnOnclick(object){
> > new Ajax.Updater('newContent', 'test2.htm', {method:'get',
> > evalScripts:true} );
>
> > }
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---