What's wrong with posting url's? A good url might give you more than just a solution.
And what exactly is not working with your code? Since this is the way to do it. Put an
alert(winHandle);
after window.open statement and you will see what to check. You will find that not only null-s will be returned. So expand your conditions:
if(typeof(winHandle)==='undefined' || winHandle==null )