Dialog text only showing when using $(document).ready

Dialog text only showing when using $(document).ready

I have a dialog that is showing just the text embedded in the page, I think it has to do with the fact that I am checking the status of Geolocation right off the bat in a document.ready function. I assume that the issue is jQuery UI isn't loaded up yet. How do I handle this? Do I load jQuery.UI first then check location?