Hrmm.. Works fine for me too. I get the expected results in FF2/FB1.0b8
On 1/2/07, John Resig <[EMAIL PROTECTED]> wrote:
I copy-and-pasted your code into firebug and it worked perfectly. Not
sure what's causing your issue - what version of Firefox and Firebug
are you running?
--John
On 1/2/07, Felix Geisendörfer <[EMAIL PROTECTED]> wrote:
>
> Not only because I can't find an appropriate subject line, but also
because
> I can't find the issue with the following code (it's not jQuery related
- I
> beg for mercy):
> ----------------------------------
> var myThoughts =
> {
> color: 'Blue'
> , name: 'Felix'
> , food: 'Lasagna'
> }
>
> var myMemory = {};
>
> for (var i in myThoughts)
> {
> myMemory[i] = function()
> {
> return this['thought'];
> }
>
> myMemory[i]['thought'] = i+': '+myThoughts[i];
> }
>
> for (var j in myMemory)
> {
> console.log('Remember: '+j);
> console.log('Result: '+myMemory[j].call(myMemory[j]));
> }
> ----------------------------------
>
> I would expect this to return the following:
> ----------------------------------
>
>
> Remember: color
> Result: color: Blue
> Remember: name
> Result: name: Felix
> Remember: food
> Result: food: Lasagna ----------------------------------
>
> But instead I am getting:
> ----------------------------------
>
>
> Remember: color
> Result: food: Lasagna
> Remember: name
> Result: food: Lasagna
> Remember: food
> Result: food: Lasagna ----------------------------------
>
> Tested this in FF 2.0 with the Firebug extension. I feel like I must
have
> missed something embarrassing stupid, but I really need to know what it
is ;
> ).
>
> -- Felix
>
> --
> --------------------------
> http://www.thinkingphp.org
> http://www.fg-webdesign.de
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>
>
>
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/