Patch for issue #2, changed the getJSON to an ajax call, worked fine. I'm not sure what was going wrong with the origin getJSON call, but this quick and dirty ajax works fine.