What is that snippet above? Is that some javascript code communicating with a CI controller called Post with a function in it called loadRecord? For debugging such a thing I use two debuggers; one of the javascript side (I use the Chrome debugger) and one on CI/PHP side (aka server) I use phpStorm which uses xDebug. Hope that helps.
proof that an old dog can learn new tricks