Archive for August, 2009

Chrome really that much faster?

I have switched to Google’s Chrome as my default browser and today was playing around with the Javascript benchmark tests.

Just wow.

Chrome (2.0.172.39) – 2965

Firefox (3.5.2) – 284

IE (8.0.6001.18702) – 58.1

Good grief.

 

VN:F [1.9.11_1134]
Rating: 0.0/10 (0 votes cast)

jQuery Replace craziness

 

I spent way too much time figuring this out.

var originalString = “Batman And Robin”;

var replacedSpaces = originalString.replace(‘ ‘, ‘_’);

This doesn’t work, it only replaces the first instace of the match, so replacedSpaces == “Batman_And Robin”.

var replacedSpaces = originalString.replace(/ /g, ‘_’);

This does work, and now replacedSpaces == “Batman_And_Robin”.

 

VN:F [1.9.11_1134]
Rating: 0.0/10 (0 votes cast)

Copyright © 1996-2010 Bits, Bytes And Burps. All rights reserved.
iDream theme by Templates Next | Powered by WordPress