#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)

11 comments

chineseGuy Jun 13, 2007 at 01:32

thanks


Alex G Jun 13, 2007 at 06:12

Awesome, thnx!


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.


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)


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=


Ryan Bates Jun 14, 2007 at 08:15

Thanks for the great tips Nicolás!


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.


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!


Ryan Bates Jun 19, 2007 at 07:40

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


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?


kino May 23, 2008 at 01:53

Pure evidence can be seen as full proof that, in spite of the continual experiencedness of noematic descriptions, a non-being of transcendental phenomenology is conceivable by virtue of a synthesis in which what is meant coincides and agrees with the repeatable act of grounding of multiplicities of cognition.

Add your comment:

(SKIP THIS ONE)

(required)

(not shown)


(required)

subscribe:
sponsored by:
if you want to help:
required:
Get Quicktime Player