When he said ignored, I think he only meant for the inspect function (which 
doesn't print d even though it exists). 

The functions will still be merged together into v3 since the $H() function 
doesn't discriminate by type AFAIK.


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Fernando
Sent: Monday, July 10, 2006 10:03 AM
To: rails-spinoffs@lists.rubyonrails.org
Subject: Re: [Rails-spinoffs] prototype hash method


"but v2.d will be ignored (type of the value is function)"
ok, but so how to do this :

I have Default Options for all my Ajax.Updater()

DefaultOptions = {
     asynchronous:true,
     evalScripts:true,
     onLoaded:function(request){Element.hide('spinner')},
     onLoading:function(request){Element.show('spinner')}
}

I have lots of Ajax.Updater()

var MyPageFunctions = {
  
   func1 : function() {
        
      var OptionForThisFunction =  {onComplete: function() { some code } };

     //I would like that {options} be OptionForThisFunction + Default Options

      new Ajax.Updater('bla','url', {options});
  },
  func2 : function() {
      var OptionForThisFunction =  {onComplete: function() { some other code } 
};
      
     //I would like that {options} be OptionForThisFunction + Default Options

      new Ajax.Updater('bla2','url', {options} );
  } 
  . . .
}

 there is a way to do this?

tks


Siegfried Puchbauer escreveu: 
try it this way:

var v1 = { a: 'value for a', b:'value for b' }; 
var v2 = { c: 'value for c', d: function(){} }; 
var v3 = $H(v2).merge($H(v1));


v3.inspect();
// #<Hash:{'c': 'value for c', 'a': 'value for a', 'b': 'value for b'}> 

but v2.d will be ignored (type of the value is function)

hth

sigi


On 7/10/06, Fernando < [EMAIL PROTECTED]> wrote: 
var v1  = {
                  a: 'value for a', 
                  b:'value for b'
               }

var v2  = {
                   c: 'value for c',
                   d: function(){some code...}
               };

var v3 = v2.merge(v1);
I'm getting an error doing this...

what is wrong?
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org 
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs




-- 
Mit freundlichen Grüßen

Siegfried Puchbauer 

_______________________________________________
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

Reply via email to