Replaced : document.write to $('head').append - in some situations is considered "bad practice", so safer to use this method.