I've just tried it in FF2.0.0.1 with Firebug 1.0b8 and I can confirm that it runs fine when the code is pasted into Firebug, but does not work in the browser - I get your origional results.
Tane On 1/3/07, Felix Geisendörfer <[EMAIL PROTECTED]> wrote: > > Wow, this one seems to be truly nasty. As stated by John and some others > here the code I posted does indeed work when copy and pasting it into the > firebug console. However, it does not work when it's part of a document in a > <script> tag! This seems to only effect FF 2.0, but is really scary because > it seems to have the potentially to brake a lot of JS code out there (unless > there is something specific with my code that triggers it). > > I just uploaded a demo demonstrating the issue: > http://demos.thinkingphp.org/js_issue/ > > Click on the link and then open the firebug console to see the results of > the log function in FF 2.0 and let me know if you can confirm this behavior. > All other browsers should handle it correctly (I put in firebug lite for > them). > > -- Felix > > -------------------------- > http://www.thinkingphp.org > http://www.fg-webdesign.de > > John Resig wrote: > I'm using Firebug 1.0b and Firefox 2.0, no problem here. Weird. > > --John > > On 1/2/07, Benjamin Sterling > <[EMAIL PROTECTED]> wrote: > > > John, I am using firebug 0.4.1 and I am getting the same response as felix. > > Felix, I think you broke my brain now... Thanks... now I need a nap. > > Sorry I could not be of help, I've never been good with arrays/objects. > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of John Resig > Sent: Tuesday, January 02, 2007 9:10 PM > To: jQuery Discussion. > Subject: Re: [jQuery] My brain is broken > > 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/ > > > _______________________________________________ > 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/
