#44
Jun 13, 2007

Debugging RJS

RJS and AJAX can be difficult to debug. Many times you don't get any error message in the browser. Learn different techniques for solving these tricky problems in this episode.
Download (40.1 MB, 7:18)
alternative download for iPod & Apple TV (17.2 MB, 7:18)

RSS Feed for Episode Comments 20 comments

1. chineseGuy Jun 13, 2007 at 01:32

thanks


2. Alex G Jun 13, 2007 at 06:12

Awesome, thnx!


3. Bobby Jun 13, 2007 at 19:06

Hey, Ryan - a common situation I come across is uploading a file via AJAX, with a progress bar (like the way Basecamp implements it for their file uploads). This could be a good idea for a future screencast.


4. Nicolás Sanguinetti Jun 13, 2007 at 22:39

As usual, great screencast! :)

Now, for what matters, the first problem is easy to debug via firebug, too. You just go to the console (Ctr+Shift+L, by the way, realy handy time saver), click on the request and watch the response, which should be the stack trace.

As for the last error, as rails wraps the whole thing in a try catch block, then it's a bit of a hassle, but if you really can't find the error, you can just go to the response in firebug, copy it and execute it on the console, finding the guilty statement really easy :)

I mean, really, firebug is the solution for all (ok, just most) problems out there. The one that aren't solved by Firebug are solved by "Use Rails" :P

Oh, and by the way, on a slightly unrelated, another great tool to incorporate into Firefox is Chris Pederick's (did I get that right?) Web Developer Toolbar. It mostly helps on some stuff that firebug hasn't come into attention yet, such as site accessibility. Those are my two "best extensions", by far.

(If you do too much front end stuff, you ought to yourself to stop using Safari while developing. I mean, I also rather use Safari as it's faster, but for development the extensions for firefox make it really great, particularly this too I recommended)


5. Nicolás Sanguinetti Jun 13, 2007 at 22:44

Oh, I forgot, there's a nice Firebug "power user demo" by Joe Hewitt (the author) @ http://video.yahoo.com/video/play?vid=cccd4aa02a3993ab06e56af731346f78.1755924&fr=


6. Ryan Bates Jun 14, 2007 at 08:15

Thanks for the great tips Nicolás!


7. Mat Holroyd Jun 14, 2007 at 16:55

Loving your screencasts. Most topics I think I know already, but each episode I learn some little gems, like TextMate and Rails method shortcuts, that make me that much more productive.

I eagerly await the next episode.


8. Geoff Evason Jun 19, 2007 at 04:24

Hey - I love the screencasts - especially the new ipod format!

I'm afraid that this one seems to have a corrupted mp4 files. I can't run them on either iTunes for windows or my iPod. This mp4 is coorrupted about 2:19 into it...

Keep up the awesome work!


9. Ryan Bates Jun 19, 2007 at 07:40

@Geoff, I recompressed it and reuploaded it. Hopefully it will work now. :)


10. Shig Jan 03, 2008 at 14:48

Ryan - thank you for these screencasts. They're extremely helpful. I have one question regarding this topic. I'm trying to update a DOM, but the DOM is in javascript so I can't see it in the browser view-source to see if I have the correct id. I can see the javascript that's sent to the browser with firebug, but it's quite indecipherable (to me). Is there any way to view the javascript as html?


11. Jeff Jul 09, 2009 at 08:34

What's funny, is when the javascript broke, it didn't add the HTML to the bottom. However, the Ruby part worked, so the comment was created. Then, after the bug in the rjs was found, and you said it was working, the page only showed two comments but the comment count showed three, because it was pulling from the db. Then, when you loaded the page in Firefox (i.e. the page was refreshed) everything was working fine. Anyway, just a little nuance, and possibly a topic of client side and server side scripting/writing to the db.


12. online paid surveys Aug 28, 2009 at 21:44

Hi...

AJAX is good and very search Engine friendly than Flash...../
I am trying to learn it..


13. forex trading Aug 28, 2009 at 21:46

Hi..

AJAX is lighter than Flash and yeah AJAX is more search Engine friendly.
Thanks for such a nice post...


14. justsoso Nov 13, 2009 at 05:50

<p>Whatever your fashion calling is or isn't, nothing says dedication like <a href="www.nfldream.net">NFL football jerseys</a>.<br>
  <a href="www.purpleuggsonline.net">Ugg boots</a> are fast becoming one of the fashion trends of the decade<br>
  get yourself a brand new pair of <a href="www.knittedugg.com">cheap Uggs</a>.</p>


15. Frank Feb 04, 2010 at 14:07

I was looking for this app, thanks!


16. paid surveys uk Apr 25, 2010 at 06:04

Thanks for sharing this great tutorial.


17. degree Jun 30, 2010 at 21:17

Thanks for sharing. i really appreciate it that you shared with us such a informative post..


18. einstein Jul 10, 2010 at 11:57

just learn how to code like pro in pure Javascript then you would not need buggy heavy slow frameworks.... and you control you own destiny and you can enjoy the power of knowing


19. Louis Vuitton JUDY PM M40258 Jul 16, 2010 at 05:13

Loving your screencasts. Most topics I think I know already, but each episode I learn some little gems, like TextMate and Rails method shortcuts, that make me that much more productive.

I eagerly await the next episode.


20. chanel shoes sale Jul 23, 2010 at 01:42

We provided wonderful shoes


21. bathroom vanity Jul 30, 2010 at 22:25

I think this is very good, and I also have some attention。


22. bamboo flooring Jul 30, 2010 at 22:30

Well, I have the following comments,


24. bar stools Aug 09, 2010 at 18:28

Really helpful for me.I have learned a lot about asp.net from this.


25. solar water heater Aug 09, 2010 at 18:30

You really know what your talking about here. Thanks for the great step by step how to blog.


25. digital sphygmomanometer Aug 09, 2010 at 18:33

Great post. Thanks for your work and sharing your information.


26. waterproof thermometer Aug 09, 2010 at 18:34

It is quite interesting and very useful. Thanks.


27. badminton racket Aug 09, 2010 at 18:36

This is a good,common sense article.Very helpful to one who is just finding the resouces about this part.It will certainly help educate me.


28. bathroom vanity Aug 09, 2010 at 18:39

Your post is rocking and knowledgeable... I really appreciate the way you write . I would like to read more from you.


29. gucci mens Aug 12, 2010 at 07:17

tks


30. gucci mens Aug 12, 2010 at 07:21

tks


31. 传奇私服 Aug 20, 2010 at 23:07

I have been reading your posts during my afternoon break, and I must admit the whole article has been very useful and very well written. I thought I would let you know that for some reason this blog does not display well in Internet Explorer 8. I wish Microsoft would stop changing their software. I have a question for you. Do you mind exchanging blog roll links? That would be really cool!


32. jordan air shoes Aug 22, 2010 at 23:11

thanks for the great screencast. I have become a huge fan of this website and I really cant wait to read you next posts! Thanks for your work and sharing your information. I going to download it


33. Discount Timberland uk Aug 24, 2010 at 00:26

nice post


34. louis vuitton shoes Aug 26, 2010 at 20:56

Thanks for sharing your article. I really enjoyed it. I put a link to my site to here so other people can read it. My readers have about the same interets


35. snow boots Aug 31, 2010 at 01:35

I also rather use Safari as it's faster, but for development the extensions for firefox make it really great, particularly this too I recommended


36. levis belts Sep 01, 2010 at 21:02

Good article! Thank you so much for sharing this post.Your views truly open my mind.

Add your comment:

(SKIP THIS ONE)

(required)

(not shown)


(use pastie or gist for code)

sponsored by:
if you want to help:
required:
Get Quicktime Player
Give Back to Open Source