Monday, June 14, 2010

Detecting Errors - javaScript

This is another way to detect error s in your php script. This also tells you that which is the place that code is currently running. This is a good but some complex calls of functions may not respond to this.

This is done by echoing a javascript.

    
echo
"<script>alert('Your message')</script>";

You can write any thing to your message.
Ex:
          1. A line number.
          2. A variable of php

Anything you want that helps to debug your code.This will alert you with a message and untill you click ok button of this alert message, the code will not continue to execute.

Have fun with this and remember to write comments. eeesY....
_______________

No comments:

Post a Comment