I have included a modified version of Benjamin Hardin's 2009 A* implementation in jsGameSoup. This is a nice general way for entities in your game to find a path between two squares on a two dimensional board with some obstructed squares. Check the demo here and the documentation here.
Have fun!