Sadly the problem with the proprietary JS calls from NK is that the behaviours can't be reproduced in a desktop browser. For all the rest of functions this is a real possibility and I've debugged more than a few problems by running the functions in the web inspector from Safari.
Other than this, as ueilat right says, you have to pepper the code with NKLog and keep track of what's doing what. Then, if everything works you can just comment all those out.
I have set-up NKMyLog which takes the same parameter as Sunny's NKLog but takes a variable set by the app upon start. That way NKLog is only used when "debugLog=true" is defined.