The javascript in wordpress should be included using the wordpress enque script.