[Javascript] js in chrome vs firefox

Philip Thompson philthathril at gmail.com
Wed Jan 12 19:17:53 CST 2011


I agree with John. I use Mootools and haven't had many chrome-only issues.

As far as your code is concerned, shouldn't this line....

itemList += ', ' + item;

be something like this...

itemList += ', ' + item.name;

You're appending actual elements, which may be why you're getting odd outputs. IDK. Something from a library might look like so...

$$('#registration input[type!=button],select,textarea').each(function (item) {
    var name = item.get('name');
    itemList += ', '+name;
    if (name.match(/^memorabilia/)) { ... }
});

Hope this helps you figure out your problem. Happy coding.

~Philip


On Jan 12, 2011, at 4:41 PM, John Warner wrote:

> When dealing with chrome best advice I've seen is jQuery or one of the
> other well established libraries.
> 
> John Warner
> 
> 
>> -----Original Message-----
>> From: javascript-bounces at lists.evolt.org [mailto:javascript-
>> bounces at lists.evolt.org] On Behalf Of Paul M Foster
>> Sent: Wednesday, January 12, 2011 3:10 PM
>> To: javascript at lists.evolt.org
>> Subject: Re: [Javascript] js in chrome vs firefox
>> 
>> On Wed, Jan 12, 2011 at 01:53:08PM -0600, jm wrote:
>> 
>>> js and oo are not my strong points so bear with me as i undoubtedly
>>> miss the proper naming conventions.  i have a page where one small
>>> portion behaves differently in chrome than it does in firefox and even
>>> ie.  the part in question is a group of text inputs where the user can
>>> enter the number of items they wish to purchase (1 of this item, 4 of
>>> that item, etc.)  as each field is populated, a dynamic table is
>>> recreated at the bottom of the page showing the new counts and
>>> purchase prices.  this works perfectly in firefox and ie (amazingly
>>> enough) but refuses to update properly in chrome.  below is the part
>>> of the script in question:
>> 
>> I don't know the answer, but I feel your pain. It's why I don't use
>> Chrome. When it first came out, I tried to run some of our internal
>> websites on it (which contain a minimal amount of Javascript). It would
>> not behave, and I couldn't imagine why. So if you find an answer, I'm
>> interested.
>> 
>> Paul


More information about the Javascript mailing list