On Jun 22, 2012, at 11:14 AM, AnichoCode wrote:
> Hello Walter,
>
> I noticed that consistent error in the script too, the script should when the
> button is clicked hide the button and in the same place display a processing
> image a little gif.
>
> The same script works on pages but not in jsfiddle or that particular page
> for some odd reason.
>
> With your code from previous post for consistency with other functions can I
> do the below or will that not work?
>
> $('.ShowPleaseWait').observe('click', function(evt){
> //do something here
> });
>
That's a jQuery selector, it won't do what you expect in Prototype. Here's the
equivalent:
$$('.ShowPleaseWait').invoke('observe', 'click', function(evt){
//do something here
});
View source on this page: http://scripty.walterdavisstudio.com/button.html
The click handler on the button is using the ID style selector, and the handler
on the reset is using the class-style selector to clean up the span. So you can
see both styles at work here.
Walter
> On Friday, June 22, 2012 3:39:31 PM UTC+1, Walter Lee Davis wrote:
> Well, you had a consistent error in the script, owing (possibly) to the way
> that jsfiddle renders the script. The function StopTimer() wasn't declared in
> the global scope, so your inline handler couldn't see it or use it. I fixed
> that by moving it into a script block at the top of your HTML, but that
> didn't seem to change anything else about the page. I'm not clear what it's
> supposed to do in any case.
>
> One thing you could try is to remove the onclick inline handler, and change
> it to an unobtrusive observer:
>
> $('centrecolumn_0_dealingcentrecolumn_0_ibtnContinue').observe('click',
> function(evt){
> //do something here
> });
>
> Observers can be "stacked", so as long as this handler doesn't clobber the
> event with stop() or return false, you should be able to have more than one
> event handler respond to the one event should you need to.
>
> Walter
>
> --
> 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/-/cTtUIKhgkCMJ.
> 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.
--
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.