Debugging Jquery

Debugging Jquery

Hi,



I am a bit new to Jquery and would like to know how you guys debug it. (I am reasonably good with Java and C# - but I dont know much of JavaScript and jQuery.) I use FireBug right now - but I dont have much experinence with it.



For example, I have a HTML table, where one column is a button. I attempted to delete the row containing the button that was clicked according to the discussions at http://stackoverflow.com/questions/170997/what-is-the-best-way-to-remove-a-table-row-with-jquery



In doing so, I attempted to try the following



  1. function deleteRow() {
  2. $(this).parent().parent().remove();
  3. }



This does not work. I think I might be selecting something wrong. I attempted to debug this by modifying my original function doing something like:



  1. function deleteRow() {
  2. var $t = $(this);
  3. alert($t);
  4. var $t1 = $(this).parent();
  5. alert($t1);
  6. $(this).parent().parent().remove();
  7. }



and I tried stepping through the method, and in the watch window in FireBug I just see $t and $t1 as [Window temp.html] (temp.html is the name of the file). This does not tell me the object that is contained in either $t or $t1. I am comparing this to debugging Java, where we can see the type of object associated with each variable.



The alert boxes above use useless too. I just get an [object Object] – which does not give me any useful information other than that the variable is not null.



I am wondering if someone can provide me some clues.



Thanks,

O.O.