[Proto-Scripty] Re: how to load scripts dinamically

2008-10-16 Thread RobG



On Oct 17, 3:22 am, SWilk <[EMAIL PROTECTED]> wrote:
> Hey,
>
> T.J. wrote a How-To on the wiki based on todays thread:
>
> http://proto-scripty.wikidot.com/prototype:how-to-load-scripts-dynami...
>
> I just have one question regarding the how-to:
>
> 
> Here's the dynamic.js file:
>
> scriptLoaded('dynamic');
> function coolFeature()
> {
>      alert('Coolness!');}
>
> 
>
> Is it possible that the execution of this included script was paused
> after scriptLoaded() call, but before coolFeauture() is created?

The ECMAScript Spec, section 14 Program says:

|  The production Program : SourceElements is evaluated as follows:
|  1. Process SourceElements for function declarations.
|  2. Evaluate SourceElements.
|  3. Return Result(2).

In other words, all the script is read, then execution begins.  You
may have issues if the function is defined in a script that is loaded
after a script that calls it.


--
Rob
--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: location.hash and event handler/window event

2008-10-16 Thread phoenix

http://www.prototypextensions.com

On 10 oct, 22:10, MikeFeltman <[EMAIL PROTECTED]> wrote:
> I'm doing this with a period executer and it seems to work great.
>
> // Monitor the hash in case the user clicked the back button.
> new PeriodicalExecuter(function(pe) {
>         var lcDocument = window.location.hash;
>         if (lcDocument.length>1) {
>                 // updateContent sets document.F1CMSContentId to the document 
> id.
>                 if (document.F1CMSContentId !== lcDocument.substring(1)) {
>                         F1.UI.UpdateContent(lcDocument.substring(1));
>                 }
>         }
>
> }, .5);
--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: help submitting a form which serves a file

2008-10-16 Thread Brian Williams
Yeah, I've fallen into that same trap with other bits of things.  Overuse of
a "fancy" gadget for no reason.  For me it's a menu and when having to
support non-js clients having a JS based menu is a bad idea (i've gotta fix
that soon s )

enjoy the code, glad i could help.



On Thu, Oct 16, 2008 at 4:49 PM, spectrus <[EMAIL PROTECTED]> wrote:

>
> Walter,
>
> Yes, you are of course correct. It just didn't occur to me, being
> responsible for just that narrow functionality, I wasn't thinking.
> And, being submerged into the AJAX world for so long, was starting to
> forget the basics.
>
> Brian,
>
> Thank you very much!
>
> I see the catch.. You produce PDF directly inside the page. I had my
> PDF generation code in a class that is called by the template engine,
> which then immediately produces and feeds an HTML template to the
> client, which confuses the hell out of FIrefox (works in IE and Opera
> though).
>
> Once again, thanks a lot!
>
> Regards,
> Max
> >
>

--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: help submitting a form which serves a file

2008-10-16 Thread spectrus

Walter,

Yes, you are of course correct. It just didn't occur to me, being
responsible for just that narrow functionality, I wasn't thinking.
And, being submerged into the AJAX world for so long, was starting to
forget the basics.

Brian,

Thank you very much!

I see the catch.. You produce PDF directly inside the page. I had my
PDF generation code in a class that is called by the template engine,
which then immediately produces and feeds an HTML template to the
client, which confuses the hell out of FIrefox (works in IE and Opera
though).

Once again, thanks a lot!

Regards,
Max
--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: how to load scripts dinamically

2008-10-16 Thread buda

look at ensure.js

On 16 окт, 20:22, SWilk <[EMAIL PROTECTED]> wrote:
> Hey,
>
> T.J. wrote a How-To on the wiki based on todays thread:
>
> http://proto-scripty.wikidot.com/prototype:how-to-load-scripts-dynami...
>
> I just have one question regarding the how-to:
>
> 
> Here's the dynamic.js file:
>
> scriptLoaded('dynamic');
> function coolFeature()
> {
>      alert('Coolness!');}
>
> 
>
> Is it possible that the execution of this included script was paused
> after scriptLoaded() call, but before coolFeauture() is created?
> If so, it would be possible that the script already announced itself,
> but is not ready yet. Then I think the callback should be called after
> all the functions was created, on the bottom of the script.
>
> I do not know the javascript on such basic level so I might be wrong.
>
> --
> Regards,
> SWilk
--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: how to load scripts dinamically

2008-10-16 Thread T.J. Crowder

> If so, it would be possible that the script already announced itself,
> but is not ready yet. Then I think the callback should be called after
> all the functions was created, on the bottom of the script.

I don't *think* so, I'll have a look at the spec out of curiosity.  In
the meantime, though, there's no reason we can't put the call at the
end instead of at the beginning -- it's not going to cause any
harm...  I've updated the page.

Thanks,
--
T.J. Crowder
tj / crowder software / com

On Oct 16, 6:22 pm, SWilk <[EMAIL PROTECTED]> wrote:
> Hey,
>
> T.J. wrote a How-To on the wiki based on todays thread:
>
> http://proto-scripty.wikidot.com/prototype:how-to-load-scripts-dynami...
>
> I just have one question regarding the how-to:
>
> 
> Here's the dynamic.js file:
>
> scriptLoaded('dynamic');
> function coolFeature()
> {
>      alert('Coolness!');}
>
> 
>
> Is it possible that the execution of this included script was paused
> after scriptLoaded() call, but before coolFeauture() is created?
> If so, it would be possible that the script already announced itself,
> but is not ready yet. Then I think the callback should be called after
> all the functions was created, on the bottom of the script.
>
> I do not know the javascript on such basic level so I might be wrong.
>
> --
> Regards,
> SWilk
--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] [wiki] how to load scripts dinamically

2008-10-16 Thread SWilk

Hey,

T.J. wrote a How-To on the wiki based on todays thread:

http://proto-scripty.wikidot.com/prototype:how-to-load-scripts-dynamically

I just have one question regarding the how-to:


Here's the dynamic.js file:

scriptLoaded('dynamic');
function coolFeature()
{
 alert('Coolness!');
}


Is it possible that the execution of this included script was paused 
after scriptLoaded() call, but before coolFeauture() is created?
If so, it would be possible that the script already announced itself, 
but is not ready yet. Then I think the callback should be called after 
all the functions was created, on the bottom of the script.

I do not know the javascript on such basic level so I might be wrong.



-- 
Regards,
SWilk

--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] menu problem...div onmouseout using Effects.SlideUp

2008-10-16 Thread bryanboling

I'm working on a dropdown menu using the script.aculo.us effects.
I've got a button that onmouseover uses the Effect.SlideDown to slide
a div down and that works great.  But, I want the menu to slide back
up when the mouse is moved off of the menu.  This is the code to lower
the menu: Menu.  It works perfect.  Here is the code to raise it
back: .

What happens is, when you move the mouse over the div after it lowers,
it retracts (onmouseover, not onmouseout like it should).  After that
first time, if you lower it again, it stays and when you move the
mouse off, it retracts like it should.  But then, the next time you
lower it, instead of sliding down like it's supposed to, it appears at
the bottom of the page and then raises and lowers randomly in the
wrong place.

Any ideas?

--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Ajax.Autoupdater hooked on a JS-generated input?

2008-10-16 Thread Alexander Mikhailian

You know what... It worked. Thanks for the hint!

On Oct 16, 5:06 pm, "T.J. Crowder" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I think the problem is probably that the script is executing before
> the browser has had a chance to add the 'input' to the DOM.  Fixing it
> *may* be as easy as changing your script to use Function.defer[1]:
>
> 
> (function(){
> new Ajax.Autocompleter('input', 'suggest', '/suggest')}).defer();
>
> 
>
> That defines an anonymous function, then schedules it for execution
> later (just a moment later) via Function.defer.
>
> More in the unofficial 
> wiki:http://proto-scripty.wikidot.com/prototype:tip-scripting-dynamically-...
>
> HTH,
> --
> T.J. Crowder
> tj / crowder software / com
>
> On Oct 16, 3:50 pm, Alexander Mikhailian <[EMAIL PROTECTED]> wrote:
>
> > I have an Ajax.Autoupdater hooked onto an input box that is rewritten
> > by an Ajax.Updater that is called from within the autocomplete list.
> > Something like this:
>
> > 
> > GET /index.html HTTP/1.0
> > 
> > new Ajax.Autocompleter('input', 'suggest', '/suggest')
> > 
> > 
> >   
> > 
> > ---
> > GET /suggest HTTP/1.0
> > 
> > Click here
> > 
> > 
>
> > At the moment, the Autocompleter does not find the 'input'  div at
> > all, after it has been rewritted by Updater. How can I make this work?
--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] "Safe" hiding of a DOM element

2008-10-16 Thread Eric

Hi,

I am slowly introducing prototype in a "plain JS" application, and I
was looking for a way to replace the following piece of code:

var pleaseWait = document.getElementById('pleaseWait');
if(pleaseWait)
{
  pleaseWait.style.display='none';
}

No rocket science here: if the processing was long enough to trigger
the "please wait" screen (which is a "P" tag here), it is hidden.

I did notice that this would NOT be the same than:
$('pleaseWait').hide();

...since the later would fail if for some reason the DOM object has
not been created.

However, I was expecting that:
Element.hide('pleaseWait');

... would be safe... but it isn't :o(

Is there a clean prototypish way to do this?
Wouldn't it be more convenient if the syntactic-sugar-free version of
Element's methods were "null-proof safe"

Eric
--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: "Safe" hiding of a DOM element

2008-10-16 Thread Justin Perkins

On Thu, Oct 16, 2008 at 10:34 AM, Eric <[EMAIL PROTECTED]> wrote:
> Wouldn't it be more convenient if the syntactic-sugar-free version of
> Element's methods were "null-proof safe"

No, that would encourage incredibly bad practices and also make
tracking down errors with non-existent elements quite difficult to
track down.

If you want to do it with a one-liner, invoke is null-safe:

$$('#pleaseWait').invoke('hide');

-justin

--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: "Safe" hiding of a DOM element

2008-10-16 Thread Roland

var pleaseWait = $('pleaseWait');
if(Object.isElement(pleaseWait)) pleaseWait.hide();

On 16 okt, 17:34, Eric <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am slowly introducing prototype in a "plain JS" application, and I
> was looking for a way to replace the following piece of code:
>
> var pleaseWait = document.getElementById('pleaseWait');
> if(pleaseWait)
> {
>   pleaseWait.style.display='none';
>
> }
>
> No rocket science here: if the processing was long enough to trigger
> the "please wait" screen (which is a "P" tag here), it is hidden.
>
> I did notice that this would NOT be the same than:
> $('pleaseWait').hide();
>
> ...since the later would fail if for some reason the DOM object has
> not been created.
>
> However, I was expecting that:
> Element.hide('pleaseWait');
>
> ... would be safe... but it isn't :o(
>
> Is there a clean prototypish way to do this?
> Wouldn't it be more convenient if the syntactic-sugar-free version of
> Element's methods were "null-proof safe"
>
> Eric
--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: "Safe" hiding of a DOM element

2008-10-16 Thread bluezehn

if($('pleaseWait')) $('pleaseWait').hide();

This is a classic coding issue. I disagree with you - in PHP I have
strict warnings on all the time so I'm always testing whether a
variable is set before accessing it. It's just a much safer way to
write code.

On Oct 16, 11:34 am, Eric <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am slowly introducing prototype in a "plain JS" application, and I
> was looking for a way to replace the following piece of code:
>
> var pleaseWait = document.getElementById('pleaseWait');
> if(pleaseWait)
> {
>   pleaseWait.style.display='none';
>
> }
>
> No rocket science here: if the processing was long enough to trigger
> the "please wait" screen (which is a "P" tag here), it is hidden.
>
> I did notice that this would NOT be the same than:
> $('pleaseWait').hide();
>
> ...since the later would fail if for some reason the DOM object has
> not been created.
>
> However, I was expecting that:
> Element.hide('pleaseWait');
>
> ... would be safe... but it isn't :o(
>
> Is there a clean prototypish way to do this?
> Wouldn't it be more convenient if the syntactic-sugar-free version of
> Element's methods were "null-proof safe"
>
> Eric
--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Ajax.Autoupdater hooked on a JS-generated input?

2008-10-16 Thread T.J. Crowder

Hi,

I think the problem is probably that the script is executing before
the browser has had a chance to add the 'input' to the DOM.  Fixing it
*may* be as easy as changing your script to use Function.defer[1]:


(function(){
new Ajax.Autocompleter('input', 'suggest', '/suggest')
}).defer();


That defines an anonymous function, then schedules it for execution
later (just a moment later) via Function.defer.

More in the unofficial wiki:
http://proto-scripty.wikidot.com/prototype:tip-scripting-dynamically-loaded-elements

HTH,
--
T.J. Crowder
tj / crowder software / com

On Oct 16, 3:50 pm, Alexander Mikhailian <[EMAIL PROTECTED]> wrote:
> I have an Ajax.Autoupdater hooked onto an input box that is rewritten
> by an Ajax.Updater that is called from within the autocomplete list.
> Something like this:
>
> 
> GET /index.html HTTP/1.0
> 
> new Ajax.Autocompleter('input', 'suggest', '/suggest')
> 
> 
>   
> 
> ---
> GET /suggest HTTP/1.0
> 
> Click here
> 
> 
>
> At the moment, the Autocompleter does not find the 'input'  div at
> all, after it has been rewritted by Updater. How can I make this work?
--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Ajax.Autoupdater hooked on a JS-generated input?

2008-10-16 Thread Alexander Mikhailian

I have an Ajax.Autoupdater hooked onto an input box that is rewritten
by an Ajax.Updater that is called from within the autocomplete list.
Something like this:


GET /index.html HTTP/1.0

new Ajax.Autocompleter('input', 'suggest', '/suggest')


  

---
GET /suggest HTTP/1.0

Click here



At the moment, the Autocompleter does not find the 'input'  div at
all, after it has been rewritted by Updater. How can I make this work?

--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: How to retrieve dynamic element in prototype

2008-10-16 Thread Jarkko Laine


I'm also dealing with event delegation in my RailsConf Europe  
presentation [1] and PeepCode eBook Unobtrusive Prototype [2], just  
out of beta.



//jarkko

[1] 
http://www.slideshare.net/supervillain/accessible-ajax-on-rails-presentation/
[2] https://peepcode.com/products/unobtrusive-prototype-js

On 16.10.2008, at 15.34, Nick Stakenburg wrote:



T.J., here's a link for you on event delegation

http://mislav.caboo.se/js/handling-events-on-elements/

--
Nick


On 16 okt, 14:04, "T.J. Crowder" <[EMAIL PROTECTED]> wrote:

Again, a much simpler, more performant solution to this issue is to
use event delegation.


VERY good point, I've updated the tip to mention that.   Need to find
some good links about event delegation and/or source a "How To" for  
it

for the wiki.  I'll ping Christophe, given that he's just done a talk
on the subject!

-- T.J. :-)

--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



--
Jarkko Laine
http://jlaine.net
http://dotherightthing.com
http://www.railsecommerce.com
http://odesign.fi




smime.p7s
Description: S/MIME cryptographic signature


[Proto-Scripty] Re: How to retrieve dynamic element in prototype

2008-10-16 Thread T.J. Crowder

> 

LOL!!

On Oct 16, 3:43 pm, Jarkko Laine <[EMAIL PROTECTED]> wrote:
> 
> I'm also dealing with event delegation in my RailsConf Europe  
> presentation [1] and PeepCode eBook Unobtrusive Prototype [2], just  
> out of beta.
> 
>
> //jarkko
>
> [1]http://www.slideshare.net/supervillain/accessible-ajax-on-rails-prese...
> [2]https://peepcode.com/products/unobtrusive-prototype-js
>
> On 16.10.2008, at 15.34, Nick Stakenburg wrote:
>
>
>
>
>
> > T.J., here's a link for you on event delegation
>
> >http://mislav.caboo.se/js/handling-events-on-elements/
>
> > --
> > Nick
>
> > On 16 okt, 14:04, "T.J. Crowder" <[EMAIL PROTECTED]> wrote:
> >>> Again, a much simpler, more performant solution to this issue is to
> >>> use event delegation.
>
> >> VERY good point, I've updated the tip to mention that.   Need to find
> >> some good links about event delegation and/or source a "How To" for  
> >> it
> >> for the wiki.  I'll ping Christophe, given that he's just done a talk
> >> on the subject!
>
> >> -- T.J. :-)
> > >
> --
> Jarkko 
> Lainehttp://jlaine.nethttp://dotherightthing.comhttp://www.railsecommerce.comhttp://odesign.fi
>
>  smime.p7s
> 3KViewDownload

--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Disable a slider

2008-10-16 Thread Walter Lee Davis

How are you disabling this slider? Inside that function, you could  
use addClassName/removeClassName to switch a CSS class on the thumb  
and track elements, maybe change their opacity for a quick hit, or  
completely change background-image srcs or something like that.

Walter

On Oct 15, 2008, at 1:20 PM, gibo wrote:

>
> Are there any examples of changing the graphics used when a slider is
> disabled.
>
> >


--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Drag and drop hyperlinked elements

2008-10-16 Thread Scott277

I'm pretty new to the framework so my apologies in advance if this is
a blatantly silly question.  When making a hyperlinked element
draggable, is there a way prevent an onclick event from firing as soon
as you drop the element?

For example:






new Draggable("dragSample", {revert: true});


In this example, the image (and its containing  become draggable
as expected.  However, as soon as the draggable is dropped, the
onclick for the anchor fires and the page is redirected to a new url.

Any way to prevent that from happening?  Or is is simply not an option
to have hyperlinked items within a draggable element without firing
the anchor?

Thank much in advance.

--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: How to retrieve dynamic element in prototype

2008-10-16 Thread Nick Stakenburg

T.J., here's a link for you on event delegation

http://mislav.caboo.se/js/handling-events-on-elements/

--
Nick


On 16 okt, 14:04, "T.J. Crowder" <[EMAIL PROTECTED]> wrote:
> > Again, a much simpler, more performant solution to this issue is to
> > use event delegation.
>
> VERY good point, I've updated the tip to mention that.   Need to find
> some good links about event delegation and/or source a "How To" for it
> for the wiki.  I'll ping Christophe, given that he's just done a talk
> on the subject!
>
> -- T.J. :-)
--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: How to retrieve dynamic element in prototype

2008-10-16 Thread T.J. Crowder

> Again, a much simpler, more performant solution to this issue is to
> use event delegation.

VERY good point, I've updated the tip to mention that.   Need to find
some good links about event delegation and/or source a "How To" for it
for the wiki.  I'll ping Christophe, given that he's just done a talk
on the subject!

-- T.J. :-)
--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: How to retrieve dynamic element in prototype

2008-10-16 Thread Tobie Langel

Again, a much simpler, more performant solution to this issue is to
use event delegation.


--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: How to retrieve dynamic element in prototype

2008-10-16 Thread T.J. Crowder

Hi,

[This'll be a repost for the email subscribers, apologies but the web
interface has clearly lost it despite counting it in the totals (as it
hasn't appeared in two hours and didn't appear when Tobie posted
below).]

> My fear is if the load of the ajax data take more than 200 ms the
> event on dynamic element doesn't works

Sorry, I thought you were talking about *after* the content was
loaded.  No (reasonable) timeout will reliably cover the time required
for the content to load; you need to use a completion callback for
that bit, then the defer.

I've written up a quick tip for this on the unofficial wiki that
should get you going:
http://proto-scripty.wikidot.com/prototype:tip-scripting-dynamically-loaded-elements

HTH,
--
T.J. Crowder
tj / crowder software / com

On Oct 16, 8:59 am, aperrin <[EMAIL PROTECTED]> wrote:
> On the one hand
>                 window.setTimeout(initSurveillance, 200); // under 200 it 
> doesn't
> works
> works
> and on the other hand
>                 initSurveillance.defer();
> doesn't works
>
> My fear is if the load of the ajax data take more than 200 ms the
> event on dynamic element doesn't works
> Il prefere use defer but it doesn't works...
>
> Any idea (i use prototype 1.6.0.3)?
>
> On 16 oct, 09:47, "T.J. Crowder" <[EMAIL PROTECTED]> wrote:
>
> > > The first assertion is right.
>
> > Ah, good!  That one caught me out at first too.
>
> > Looks like I forgot to include the reference I flagged with [1].
> > It's:http://prototypejs.org/api/function/defer
>
> > -- T.J. :-)
>
> > On Oct 16, 7:51 am, aperrin <[EMAIL PROTECTED]> wrote:
>
> > > The first assertion is right. With a 'window.setTimeOut' i see the
> > > dynamic element.
>
> > > Thanks.
>
>
--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: How to retrieve dynamic element in prototype

2008-10-16 Thread Tobie Langel

You have to use defer from inside the callback you pass to your ajax
object:

new Ajax.Request(url, {
  onComplete: function() {
initSurveillance.defer();
  }
});


On Oct 16, 9:59 am, aperrin <[EMAIL PROTECTED]> wrote:
> On the one hand
>                 window.setTimeout(initSurveillance, 200); // under 200 it 
> doesn't
> works
> works
> and on the other hand
>                 initSurveillance.defer();
> doesn't works
>
> My fear is if the load of the ajax data take more than 200 ms the
> event on dynamic element doesn't works
> Il prefere use defer but it doesn't works...
>
> Any idea (i use prototype 1.6.0.3)?
>
> On 16 oct, 09:47, "T.J. Crowder" <[EMAIL PROTECTED]> wrote:
>
> > > The first assertion is right.
>
> > Ah, good!  That one caught me out at first too.
>
> > Looks like I forgot to include the reference I flagged with [1].
> > It's:http://prototypejs.org/api/function/defer
>
> > -- T.J. :-)
>
> > On Oct 16, 7:51 am, aperrin <[EMAIL PROTECTED]> wrote:
>
> > > The first assertion is right. With a 'window.setTimeOut' i see the
> > > dynamic element.
>
> > > Thanks.
--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Dynamic script file loading

2008-10-16 Thread T.J. Crowder

Hey Jason,

[Call me T.J. :-)]

Caveat:  I have not had to do this in the wild, so there are sure to
be better answers from others.  I'll throw out an example that works
in my limited testing (FF3, IE6, Safari 3, Opera 9):

Loading the script dynamically from the statically-loaded script
already on the page (in my example file I triggered this vi a button):
* * *
function go()
{
var head;
var script;

head = $$('head')[0];
if (head)
{
script = new Element('script', { type: 'text/javascript', src:
'dynamic.js' });
head.appendChild(script);
}
}
* * *

A function in the statically-loaded script that other scripts can use
to announce themselves:
* * *
function hello(name)
{
alert('Script "' + name + '" loaded');
}
* * *

My dynamic.js file:
* * *
hello('dynamic');
function coolness()
{
alert('Coolness!');
}
* * * *

A modified version of hello() demonstrating that the dynamically-
loaded script is accessible from the statically-loaded one:
* * * *
function hello(name)
{
alert('Script "' + name + '" loaded');
if (name == 'dynamic')
{
coolness();
}
}
* * * *

Complete code on Pastie:
HTML+static script: http://pastie.org/293753
dynamic.js: http://pastie.org/293754

Again, though, I wouldn't be at all surprised if there are subtlties
and wrinkles that aren't dreamt of in my philosophy -- or at least not
handled in this code. :-)
--
T.J. Crowder
tj / crowder software / com

On Oct 16, 10:54 am, "jason maina" <[EMAIL PROTECTED]> wrote:
> @Crowder:
> This kind of amateurish, how will the script announce itself?
> Kind of don't understand the concept
>
> 2008/10/16 T.J. Crowder <[EMAIL PROTECTED]>
>
>
>
> > > When the "script" element is inserted into the document body, does the
> > > currently-running script wait for the js file to be downloaded and
> > executed?
>
> > You'll want to try it out on the browsers you're targeting, but I tend
> > to doubt it:  All the code inserting the tag is doing is inserting the
> > script element in the DOM, the browser does the rest and I'm guessing
> > does it on its own thread(s).  Probably best to have the script you're
> > loading announce itself to the script loading it when it loads.  Then
> > you know it's there.
> > --
> > T.J. Crowder
> > tj / crowder software / com
>
> > On Oct 15, 8:08 pm, "Hector Virgen" <[EMAIL PROTECTED]> wrote:
> > > When the "script" element is inserted into the document body, does the
> > > currently-running script wait for the js file to be downloaded and
> > executed?
> > > Or does the js file download in the background while the current script
> > > finishes?
> > > -Hector
>
> > > 2008/10/15 buda <[EMAIL PROTECTED]>
>
> > > > tere is a beautifull script ENSURE - try it
>
> > > > On 15 окт, 14:16, "jason maina" <[EMAIL PROTECTED]> wrote:
> > > > > Hi,
>
> > > > > Is it possible to load script files only when they are needed.
> > > > > In the application im currently making there are too many script(js)
> > > > files
> > > > > loaded on the parent page yet in the entire life-cycle of the
> > application
> > > > > usage some tabs will not even be clicked hence the idea to only load
> > > > script
> > > > > files when needed.
>
> > > > > Thank you in advance.
>
> > > > > - Jason
>
> > > --
> > > -Hector
>
>
--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Datagrid using json

2008-10-16 Thread jason maina
Might take me a century before I get a clue on JQuery, then another issue
with it pops-up, its affiliation M$ really dont like that direction

On Wed, Oct 15, 2008 at 11:04 PM, spectrus <[EMAIL PROTECTED]> wrote:

>
> What about jQuery grids (flexigrid, ingrid)? Haven't worked with them,
> but they look pretty mature.
>
>
> On Oct 15, 12:56 pm, "jason maina" <[EMAIL PROTECTED]> wrote:
> > @spectrus:
> > Already have sampled ExtJS has a very cool UI but very heavy on a
> > site/application, sole reason I'm still stuck with proto-scripty.
> >
> > Wish prototype+script.aculo.us could come up with cool UI just added
> when
> > needed as well as being light weight :D
> >
> >
>

--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Dynamic script file loading

2008-10-16 Thread jason maina
I mean an amateurish question, please dont get me wrong on it

2008/10/16 jason maina <[EMAIL PROTECTED]>

> @Crowder:
> This kind of amateurish, how will the script announce itself?
> Kind of don't understand the concept
>
> 2008/10/16 T.J. Crowder <[EMAIL PROTECTED]>
>
>
>> > When the "script" element is inserted into the document body, does the
>> > currently-running script wait for the js file to be downloaded and
>> executed?
>>
>> You'll want to try it out on the browsers you're targeting, but I tend
>> to doubt it:  All the code inserting the tag is doing is inserting the
>> script element in the DOM, the browser does the rest and I'm guessing
>> does it on its own thread(s).  Probably best to have the script you're
>> loading announce itself to the script loading it when it loads.  Then
>> you know it's there.
>> --
>> T.J. Crowder
>> tj / crowder software / com
>>
>> On Oct 15, 8:08 pm, "Hector Virgen" <[EMAIL PROTECTED]> wrote:
>> > When the "script" element is inserted into the document body, does the
>> > currently-running script wait for the js file to be downloaded and
>> executed?
>> > Or does the js file download in the background while the current script
>> > finishes?
>> > -Hector
>> >
>> > 2008/10/15 buda <[EMAIL PROTECTED]>
>> >
>> >
>> >
>> >
>> >
>> > > tere is a beautifull script ENSURE - try it
>> >
>> > > On 15 окт, 14:16, "jason maina" <[EMAIL PROTECTED]> wrote:
>> > > > Hi,
>> >
>> > > > Is it possible to load script files only when they are needed.
>> > > > In the application im currently making there are too many script(js)
>> > > files
>> > > > loaded on the parent page yet in the entire life-cycle of the
>> application
>> > > > usage some tabs will not even be clicked hence the idea to only load
>> > > script
>> > > > files when needed.
>> >
>> > > > Thank you in advance.
>> >
>> > > > - Jason
>> >
>> > --
>> > -Hector
>> >>
>>
>

--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Dynamic script file loading

2008-10-16 Thread jason maina
@Crowder:
This kind of amateurish, how will the script announce itself?
Kind of don't understand the concept

2008/10/16 T.J. Crowder <[EMAIL PROTECTED]>

>
> > When the "script" element is inserted into the document body, does the
> > currently-running script wait for the js file to be downloaded and
> executed?
>
> You'll want to try it out on the browsers you're targeting, but I tend
> to doubt it:  All the code inserting the tag is doing is inserting the
> script element in the DOM, the browser does the rest and I'm guessing
> does it on its own thread(s).  Probably best to have the script you're
> loading announce itself to the script loading it when it loads.  Then
> you know it's there.
> --
> T.J. Crowder
> tj / crowder software / com
>
> On Oct 15, 8:08 pm, "Hector Virgen" <[EMAIL PROTECTED]> wrote:
> > When the "script" element is inserted into the document body, does the
> > currently-running script wait for the js file to be downloaded and
> executed?
> > Or does the js file download in the background while the current script
> > finishes?
> > -Hector
> >
> > 2008/10/15 buda <[EMAIL PROTECTED]>
> >
> >
> >
> >
> >
> > > tere is a beautifull script ENSURE - try it
> >
> > > On 15 окт, 14:16, "jason maina" <[EMAIL PROTECTED]> wrote:
> > > > Hi,
> >
> > > > Is it possible to load script files only when they are needed.
> > > > In the application im currently making there are too many script(js)
> > > files
> > > > loaded on the parent page yet in the entire life-cycle of the
> application
> > > > usage some tabs will not even be clicked hence the idea to only load
> > > script
> > > > files when needed.
> >
> > > > Thank you in advance.
> >
> > > > - Jason
> >
> > --
> > -Hector
> >
>

--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: serialize array

2008-10-16 Thread T.J. Crowder

Hi,

> ...I do agree that your answer
> was slightly OT and a tad condescending

I'm sorry if it came off that way, please accept my apologies.  With
respect, I think you're misreading though:  It's quite the opposite,
I'm genuinely asking if there's something about HTML forms that I've
been missing.  I thought I made that clear in the paragraph starting
with:

> > Usually a gap like this -- where a number of people are doing
> > something I've never heard of and can't find a reference for -- means
> > I've missed something somewhere along the line.

I even gave an example where that had happened before and I'd learned
from it.

> ...if you read the bottom of this page
> http://www.prototypejs.org/api/form/serializefrom the API of the
> framework for which this group was created.

Thanks for pointing that out -- I assume you mean this comment:

<< Keep in mind that "hobbies" multiple select should really be named
"hobbies[]" if we're posting to a PHP or Ruby on Rails backend because
we want to send an array of values instead of a single one. >>

This is *exactly* what I meant about me missing something.  I wouldn't
expect the PHP or Ruby folks to be using brackets if they aren't
allowed, but the references I've found so far suggest they aren't.
Can someone point me to a standards reference for this?

> I am new here and you're obviously the top poster...

Wow, I didn't realize that.  It's only because this group is a new
replacement for the old group[1] and I've been pretty active lately.
All time I think it's still Christophe. :-)

[1] http://groups.google.com/group/rubyonrails-spinoffs

> ...I'm the
> one who'll be made to look like a fool.

I certainly hope not.
--
T.J. Crowder
tj / crowder software / com


On Oct 16, 8:49 am, delishus <[EMAIL PROTECTED]> wrote:
> I apologize for my poor terminology, but I do agree that your answer
> was slightly OT and a tad condescendingbut thanks for taking the
> time anyway.  I've been using this method for some time and I'd assume
> I'm not the only one if you read the bottom of this 
> pagehttp://www.prototypejs.org/api/form/serializefrom the API of the
> framework for which this group was created.  There were also changes
> made to prototype.js to deal with these "arrays" (http://
> dev.rubyonrails.org/ticket/7516).
>
> I am new here and you're obviously the top poster, so I accept I'm the
> one who'll be made to look like a fool.
>
> If anyone else has had a similar situation with these "arrays" and has
> an alternative solution they can recommend, please let me know.
>
> Basically the input boxes are created dynamically, so when a user
> clicks "add another hobby", an additional  name="hobby[]" value=""> gets added to the div. Hence my use of the
> "hobby[]".  In php I can read this as an array, implode the data and
> add it to the database.
>
> Thanks
>
> On Oct 16, 12:01 am, "T.J. Crowder" <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > This may be slightly OT, but people post things periodically with
> > these "arrays" of form controls.  Believe it or not, I've managed to
> > get through several years of web programming without having heard
> > anything official suggesting that you *can* have "arrays" of form
> > controls.  (Radio buttons aren't arrays, but they do that funny thing
> > where they "share" their control name.[1])  Are these names in the
> > form "hobbies[]" really valid?  I don't see any mention of control
> > arrays in the W3 docs for the "name" attribute of input elements[2].
> > The "name" attribute is listed as being CDATA, the discussion of the
> > CDATA[3] calls out the "name" attribute specifically, saying "...ID
> > and NAME tokens must begin with a letter ([A-Za-z]) and may be
> > followed by any number of letters, digits ([0-9]), hyphens ("-"),
> > underscores ("_"), colons (":"), and periods (".")."  So no brackets
> > then.
>
> > Usually a gap like this -- where a number of people are doing
> > something I've never heard of and can't find a reference for -- means
> > I've missed something somewhere along the line.  (My first experience
> > of running into JavaScript object literal format was like that; at the
> > time I hadn't read the spec and was *totally* flummoxed by what I
> > saw.  Made me seek out and read the spec.)
>
> > If this is one of those situations, could someone point me at the
> > relevant reference so I can bone up? :-)
>
> > If not, though, that may be your answer:  They're invalid names.
>
> > [1]http://www.w3.org/TR/html401/interact/forms.html#radio
> > [2]http://www.w3.org/TR/html401/interact/forms.html#control-name
> > [3]http://www.w3.org/TR/html401/interact/forms.html#adef-name-INPUT
>
> > HTTH,
> > --
> > T.J. Crowder
> > tj / crowder software / com
>
> > On Oct 15, 6:39 pm, delishus <[EMAIL PROTECTED]> wrote:
>
> > > Hi..wonder if anyone can point me in the right direction with this
> > > issue.
>
> > > I'm using serialize to send form data to an ajax.Updater (to php
> > > backend), but the form 

[Proto-Scripty] Re: How to retrieve dynamic element in prototype

2008-10-16 Thread T.J. Crowder

Hi,

> My fear is if the load of the ajax data take more than 200 ms the
> event on dynamic element doesn't works

I was assuming the content had already been *loaded* and all we were
waiting for was the browser to be ready.  ANY reasonable timeout will
be unreliable if it's supposed to cover the time *loading* the
content.  Rather than using a timeout, you'll need to use a completion
event.

I've written up a quick tip for this and put it on the unofficial
wiki, it should get you going:
http://proto-scripty.wikidot.com/prototype:tip-scripting-dynamically-loaded-elements

HTH,
--
T.J. Crowder
tj / crowder software / com


On Oct 16, 8:59 am, aperrin <[EMAIL PROTECTED]> wrote:
> On the one hand
>                 window.setTimeout(initSurveillance, 200); // under 200 it 
> doesn't
> works
> works
> and on the other hand
>                 initSurveillance.defer();
> doesn't works
>
> My fear is if the load of the ajax data take more than 200 ms the
> event on dynamic element doesn't works
> Il prefere use defer but it doesn't works...
>
> Any idea (i use prototype 1.6.0.3)?
>
> On 16 oct, 09:47, "T.J. Crowder" <[EMAIL PROTECTED]> wrote:
>
> > > The first assertion is right.
>
> > Ah, good!  That one caught me out at first too.
>
> > Looks like I forgot to include the reference I flagged with [1].
> > It's:http://prototypejs.org/api/function/defer
>
> > -- T.J. :-)
>
> > On Oct 16, 7:51 am, aperrin <[EMAIL PROTECTED]> wrote:
>
> > > The first assertion is right. With a 'window.setTimeOut' i see the
> > > dynamic element.
>
> > > Thanks.
>
>
--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: serialize array

2008-10-16 Thread delishus

I apologize for my poor terminology, but I do agree that your answer
was slightly OT and a tad condescendingbut thanks for taking the
time anyway.  I've been using this method for some time and I'd assume
I'm not the only one if you read the bottom of this page
http://www.prototypejs.org/api/form/serialize from the API of the
framework for which this group was created.  There were also changes
made to prototype.js to deal with these "arrays" (http://
dev.rubyonrails.org/ticket/7516).

I am new here and you're obviously the top poster, so I accept I'm the
one who'll be made to look like a fool.

If anyone else has had a similar situation with these "arrays" and has
an alternative solution they can recommend, please let me know.

Basically the input boxes are created dynamically, so when a user
clicks "add another hobby", an additional  gets added to the div. Hence my use of the
"hobby[]".  In php I can read this as an array, implode the data and
add it to the database.

Thanks

On Oct 16, 12:01 am, "T.J. Crowder" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> This may be slightly OT, but people post things periodically with
> these "arrays" of form controls.  Believe it or not, I've managed to
> get through several years of web programming without having heard
> anything official suggesting that you *can* have "arrays" of form
> controls.  (Radio buttons aren't arrays, but they do that funny thing
> where they "share" their control name.[1])  Are these names in the
> form "hobbies[]" really valid?  I don't see any mention of control
> arrays in the W3 docs for the "name" attribute of input elements[2].
> The "name" attribute is listed as being CDATA, the discussion of the
> CDATA[3] calls out the "name" attribute specifically, saying "...ID
> and NAME tokens must begin with a letter ([A-Za-z]) and may be
> followed by any number of letters, digits ([0-9]), hyphens ("-"),
> underscores ("_"), colons (":"), and periods (".")."  So no brackets
> then.
>
> Usually a gap like this -- where a number of people are doing
> something I've never heard of and can't find a reference for -- means
> I've missed something somewhere along the line.  (My first experience
> of running into JavaScript object literal format was like that; at the
> time I hadn't read the spec and was *totally* flummoxed by what I
> saw.  Made me seek out and read the spec.)
>
> If this is one of those situations, could someone point me at the
> relevant reference so I can bone up? :-)
>
> If not, though, that may be your answer:  They're invalid names.
>
> [1]http://www.w3.org/TR/html401/interact/forms.html#radio
> [2]http://www.w3.org/TR/html401/interact/forms.html#control-name
> [3]http://www.w3.org/TR/html401/interact/forms.html#adef-name-INPUT
>
> HTTH,
> --
> T.J. Crowder
> tj / crowder software / com
>
> On Oct 15, 6:39 pm, delishus <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi..wonder if anyone can point me in the right direction with this
> > issue.
>
> > I'm using serialize to send form data to an ajax.Updater (to php
> > backend), but the form contains array data and any fields such as
> > name="hobbies[]" (square brackets) returns hobbies%5B%5D hence killing
> > the post.  IE processes the form fine but Firefox and Safari fail on
> > this issue.
>
> > Am I missing something obvious or does someone have a solution for
> > this?
>
> > Thanks!- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: How to retrieve dynamic element in prototype

2008-10-16 Thread aperrin

On the one hand
window.setTimeout(initSurveillance, 200); // under 200 it 
doesn't
works
works
and on the other hand
initSurveillance.defer();
doesn't works

My fear is if the load of the ajax data take more than 200 ms the
event on dynamic element doesn't works
Il prefere use defer but it doesn't works...


Any idea (i use prototype 1.6.0.3)?

On 16 oct, 09:47, "T.J. Crowder" <[EMAIL PROTECTED]> wrote:
> > The first assertion is right.
>
> Ah, good!  That one caught me out at first too.
>
> Looks like I forgot to include the reference I flagged with [1].
> It's:http://prototypejs.org/api/function/defer
>
> -- T.J. :-)
>
> On Oct 16, 7:51 am, aperrin <[EMAIL PROTECTED]> wrote:
>
> > The first assertion is right. With a 'window.setTimeOut' i see the
> > dynamic element.
>
> > Thanks.
--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: How to retrieve dynamic element in prototype

2008-10-16 Thread T.J. Crowder

> The first assertion is right.

Ah, good!  That one caught me out at first too.

Looks like I forgot to include the reference I flagged with [1].
It's:
http://prototypejs.org/api/function/defer

-- T.J. :-)

On Oct 16, 7:51 am, aperrin <[EMAIL PROTECTED]> wrote:
> The first assertion is right. With a 'window.setTimeOut' i see the
> dynamic element.
>
> Thanks.
--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: serialize array

2008-10-16 Thread T.J. Crowder

Hi,

This may be slightly OT, but people post things periodically with
these "arrays" of form controls.  Believe it or not, I've managed to
get through several years of web programming without having heard
anything official suggesting that you *can* have "arrays" of form
controls.  (Radio buttons aren't arrays, but they do that funny thing
where they "share" their control name.[1])  Are these names in the
form "hobbies[]" really valid?  I don't see any mention of control
arrays in the W3 docs for the "name" attribute of input elements[2].
The "name" attribute is listed as being CDATA, the discussion of the
CDATA[3] calls out the "name" attribute specifically, saying "...ID
and NAME tokens must begin with a letter ([A-Za-z]) and may be
followed by any number of letters, digits ([0-9]), hyphens ("-"),
underscores ("_"), colons (":"), and periods (".")."  So no brackets
then.

Usually a gap like this -- where a number of people are doing
something I've never heard of and can't find a reference for -- means
I've missed something somewhere along the line.  (My first experience
of running into JavaScript object literal format was like that; at the
time I hadn't read the spec and was *totally* flummoxed by what I
saw.  Made me seek out and read the spec.)

If this is one of those situations, could someone point me at the
relevant reference so I can bone up? :-)

If not, though, that may be your answer:  They're invalid names.

[1] http://www.w3.org/TR/html401/interact/forms.html#radio
[2] http://www.w3.org/TR/html401/interact/forms.html#control-name
[3] http://www.w3.org/TR/html401/interact/forms.html#adef-name-INPUT

HTTH,
--
T.J. Crowder
tj / crowder software / com

On Oct 15, 6:39 pm, delishus <[EMAIL PROTECTED]> wrote:
> Hi..wonder if anyone can point me in the right direction with this
> issue.
>
> I'm using serialize to send form data to an ajax.Updater (to php
> backend), but the form contains array data and any fields such as
> name="hobbies[]" (square brackets) returns hobbies%5B%5D hence killing
> the post.  IE processes the form fine but Firefox and Safari fail on
> this issue.
>
> Am I missing something obvious or does someone have a solution for
> this?
>
> Thanks!
--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
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
-~--~~~~--~~--~--~---