Sorry I misread...
Even though I understand what Greg says it should work.
Personally, I never use onclick.
Instead I use Event.observe
Have you tried this:
onclick="alert('test')";
to see if this works first?
On Mar 21, 2006, at 2:55 PM, Guillermo Movia wrote:
No, ultima2() doesn't call the Ajax.Updater, it comes in the response,
but nothing else. The button also came in the response.
Which is the way to use this function?
Guillermo
2006/3/21, Deco Rior <[EMAIL PROTECTED]>:
It looks like it is not recognizing the calling function "utlima2"
Also the utima2 never calls the Ajax.Updater??
Deco
The pr
On Mar 21, 2006, at 2:40 PM, Gregory Hill wrote:
Does your response have <script> tags around the script?
evalScripts
looks for that and runs any code inside <script> tags. It doesn't
just
blindly eval the whole block. You should be able to also have html
markup in the response.
Greg
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:rails-spinoffs-
[EMAIL PROTECTED] On Behalf Of Guillermo Movia
Sent: Tuesday, March 21, 2006 2:34 PM
To: rails-spinoffs@lists.rubyonrails.org
Subject: Re: [Rails-spinoffs] Javascript Code inside an Ajax
response
Thanks for the answers, but It isn't work yet. This is the code in
the
ajax response. Before this, the response has a code for an html
table
(i don't know if i could mix javascript code and html)
ultima2 = function() {
var ultimaNoticia = 677;
$('lastStory').innerHTML = ultimaNoticia;
};
</script>
<input type=button value='Apretar' onclick='ultima2()' />
Now, my ajax call says:
var consultaAjax = new Ajax.Updater (
'tabla',
url,
{
method: 'get',
parameters: pars,
evalScripts: true
});
}
But when i press the button, it said ultima2 is not declared. Which
thing i am making bad.
Thanks
Guillermo
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs