Posts

Showing posts from May, 2016

replace all in JavaScript

Maybe you already had the problem that you needed to use a a simple replace in JavaScript. The problem is while using "string.replace('old string', 'new string')" just the first match will be replaced. This is kind of weird if you are coming from the .Net world. So there are two ways to perform a replace all in JavaScript: the replacing with arrays and the regex replacing

is the DateTime empty?

Have you ever tryied to check a DateTime for the state "not set"? Some of you would say "this is easy, I will check the variable for null" like this: 1 2 3 4 if (myDateTime == null ) { // it is empty } The funny fact is: this will never work. But why?

Loading JavaScript files dynamicly and waiting async for it

Have you ever been trying to load JavaScript dynamicly? That is a cool way to reduce the initial loading time, but there are way more usecases for it. The question is: how to do it?