I tried following Ryan Bates' railscast on rjs tips
(#45 RJS Tips - RailsCasts) and apply his method of
using if-else inside the rjs template, but can't seem to get it to work.
Basically, I'm trying to toggle the text on a link when it's clicked
(test.js.rjs):
Look closely and see how you forgot the “)” after “‘one’”. Javascript is very punctuation sensitive, you need to pay special attention to it. Also, use Firefox for testing and install Firebug to debug your javascript. It would have indicated this error.
Look closely and see how you forgot the ")" after "'one'". Javascript
is very punctuation sensitive, you need to pay special attention to
it. Also, use Firefox for testing and install Firebug to debug your
javascript. It would have indicated this error.
Thanks Peter. I changed my code to include the closing parenthesis,
but
it seems to not work still. I am using firefox w/ firebug, although
I'm
still not that seasoned in debugging js - I'll read up on that. Here's
what I have now:
Do links even have a value attribute? It doesn't seem to contain the
links text if that's what you were expecting.