I'm developing a login system using jQuery mobile, javascript and php. The following code does not seem to run until after I refresh the page. How can I resolve this?

```
$(document).ready(function(){ alert('hello')};

```