create an array
vars =
array("com","net","us","etc","etc")
then loop through it
for(i=0;i<sizeof(vars);i++){
new Ajax.Updater(table[i], ''json.php'',
{
method: ''get'',
parameters: {checkDomain:
$F(''checkDomain''), extension: vars[i]},
onLoading: this.loading,
onLoaded: this.loaded,
onFailure: this.failure
}
);
}
buyer beware: this is untested and I''m not very strong with the JS
mojo so my syntax could be off
On Nov 29, 2007 9:26 PM, Haris
<isharis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
> new Ajax.Updater(table[0],
''json.php'',
> {
> method: ''get'',
> parameters: {checkDomain:
$F(''checkDomain''), extension: ''com''},
> onLoading: this.loading,
> onLoaded: this.loaded,
> onFailure: this.failure
> }
> );
>
> new Ajax.Updater(table[1],
''json.php'',
> {
> method: ''get'',
> parameters: {checkDomain:
$F(''checkDomain''), extension: ''net''},
> onLoading: this.loading,
> onLoaded: this.loaded,
> onFailure: this.failure
> }
> );
>
> new Ajax.Updater(table[2],
''json.php'',
> {
> method: ''get'',
> parameters: {checkDomain:
$F(''checkDomain''), extension: ''org''},
> onLoading: this.loading,
> onLoaded: this.loaded,
> onFailure: this.failure
> }
> );
>
> new Ajax.Updater(table[3],
''json.php'',
> {
> method: ''get'',
> parameters: {checkDomain:
$F(''checkDomain''), extension: ''us''},
> onLoading: this.loading,
> onLoaded: this.loaded,
> onFailure: this.failure
> }
> );
>
> I currently have this set of block to update the td, it would be
> easier if I can iterate the ajax queries with an array called
> extension (values will be used in parameters). I tried doing it but
> failed. Any help will be appreciated.
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---