How to properly generate exceptions in PHP/Dojo when returning javascript code
问题 I am having difficulty understanding how exceptions are handled when code is fetched dynamically via AJAX and executed via eval . With clientside javascript, it is rather simple, if I have a piece of code such as this var j = 'some string'; j.propA.x++; this will raise an exception because propA , which is of type undefined does not have an x . Furthermore, the exception raised is very easy to understand. Now lets put the above code in a text file, lets call it test.js , and store it on the