Fix dashboard widgets issue, cache jQuery variables

Suggestion made in 77d42b508f37b2b55e53d607071593f2e1db9d1c by gavin19
Merge pull request #616 from mc10/minor-fixes

Fix dashboard widgets issue, cache jQuery variables