
If you are printing XML out, the very first print statement should be: Remember, you need a header to tell the web browser what type of text you are outputting. This is probably a problem with (a) permissions (see above) or (b) the header that you are printing first in your script. Perl runs from ssh, and even outputs with no errors.: Great! You are almost there.Your file permissions are just set incorrectly. Make sure it is "my $var =" and not just "$var =". line 11: This usually means you are declaring a variable without using the "my" specifier.


Will still have to examine the line and the exception to figure out what is wrong. For instance, if something goes wrong in JavaScript, it should pop-up the debugger and show you the line number where the error occurred. Once you do this, Chrome will catch exceptions in the debugger.The picture below shows what you are looking for (this shows BEFORE clicking): Click on it until when you hover it says something like "Pause on all exceptions" (the color will probably change). Hover over each icon to find the one that talks about pausing on exceptions.Near the top of this are some icons that control debugging (used to Run, Pause, Step etc.). There should be a small pane in the bottom-right of your screen.Click on the "Sources" tab (this may be the word Sources, or may be an icon).Right-click inside Chrome (on the page) and pick "Inspect element".If you get a server error from the navbar use, see "Perl is not working" below.Ī very useful feature is to tell Chrome's Javascript debugger to stop whenever it encounters any exception (roughly, any kind of JavaScript error). Type it into your browser! What happens? If it displays exactly what you expect, the problem is probably in your javascript (now put an alert statement in the function that ajax should call on return). Type your Perl script into the navbar.If it is blank, then it returned nothing. This shows you exactly what your Perl script returned to Ajax. If that looks ok, click the "Response" tab.
HTML INSPECTOR FOR PROPER CODE CODE
You also want to look at the first line, "Request URL" and lower down, "Query String Parameters" to see what your ajax code sent to your script. A "Status Code" of "200 OK" means your Perl was called and it returned something valid. Look in the Headers and see if everything looks normal. It will now show on the right your "Headers" and your "Response". If Ajax sent the request, it showed up in the Network tab. Did a message show up in the Network panel? If no, it is not Perl's fault, it is something in your Javascript's ajax code. Leaving this open, interact with your web page so that your Ajax call would normally be made if it was working how you thought it should. In Chrome, open the debugging panel and click Network. No Javascript errors, but Ajax still doesn't work (also known as "Network help") You can find everything in there, so if you think your code should have created a tag, try to find it! It may have appeared in a different place in your DOM than you expect, and this will help you discover that. This brings up the Elements and you can navigate your page's DOM tree. Right-click your page (anywhere), select "Inspect Elements".

