Of Sam
Sent: Monday, July 10, 2006 10:51 AM
To: rails-spinoffs@lists.rubyonrails.org
Subject: RE: [Rails-spinoffs] prototype hash method
Sam wrote:
> Is it easy to explain the difference between a hash
>
> var myHash = {a: 'value for a'}
>
> and an object
>
>
Here it is as a one-liner that I use often to merge a set of options with a default:options = Object.extend(Object.extend({}, _defaultOptions), options);_defaultOptions = your defaultsoptions = passed in options and then the merged options
BrandonOn 7/10/06, Sam <[EMAIL PROTECTED]> wrote:
Sam wrot
Sam wrote:
> Is it easy to explain the difference between a hash
>
> var myHash = {a: 'value for a'}
>
> and an object
>
> var myObject = {a: 'value for a'}
There is no difference between those. They are both associative arrays
(hashes).
---
S
;[EMAIL PROTECTED]>
Subject: Re: [Rails-spinoffs] prototype hash method
To: rails-spinoffs@lists.rubyonrails.org
Message-ID:
<[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"
try it this way:
var v1 = { a: 'value for a', b:'value for
auer" <[EMAIL PROTECTED]>
Subject: Re: [Rails-spinoffs] prototype hash method
To: rails-spinoffs@lists.rubyonrails.org
Message-ID:
<[EMAIL PROTECTED]>
Content-Type: text/plain; charset="iso-8859-1"
try it this way:
var v1 = { a: 'value for a', b:'valu
};
var v3 = Object.extend(v1, v2);
This will preserve your function.
regards,
Tobie
On 10 juil. 2006, at 16:03,
[EMAIL PROTECTED] wrote:
From: "Siegfried Puchbauer" <[EMAIL PROTECTED]>
Subject: Re: [Rails-spinoffs] prototype hash method
To: rails-spinoffs@lists.ru
D] [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
"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){
Sam wrote:
> Is it easy to explain the difference between a hash
>
> var myHash = {a: 'value for a'}
>
> and an object
>
> var myObject = {a: 'value for a'}
There is no difference between those. They are both associative arrays (hashes).
--
Michael Peters
Developer
Plus Three, LP
__
Title: Message
Is it
easy to explain the difference between a hash
var
myHash = {a: 'value for a'}
and an
object
var
myObject = {a: 'value for a'}
Sam
___
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonr
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();// #
but v2.d will be ignored (type of th
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?
___
12 matches
Mail list logo