This is a good candidate for a util function (it's used in more than one place). It's possible that jQuery itself can be used in WinStore/JS apps as well, so if this is the case, we can remove this "if" (and do all with jQuery). If it can't be used, then let's define a helper function (in the platformSpecific file).