On Dec 20, 5:25 am, Ken Wagner <[email protected]> wrote: > MarnenLaibow-Koser wrote: > > Sure: <%= link_to 'Back', '#', {}, :onclick => 'history.go(-1)' %> [...] > I have "<%= javascript_include_tag 'prototype' %>" in the layout head. > > But the code above doesn't work. Is there a different "turn on > JavaScript" line of code needed?
No. Protoype is not even needed for this -- that is, no javascript_include_tag is necessary -- because history.go is a basic JavaScript feature, not a Prototype library function. > > After much digging and searching I discovered this: > > <a href="Javascript:history.go(-1)">Back</a> > > I think it automatically turns on JS. No. Nothing "automatically turns on JS". For obvious reasons, there is no JavaScript code that would turn on JavaScript interpretation in the user's browser. Check your browser options and make sure you have JavaScript turned on -- that's the only way to do it. Also, using javascript: pseudo-URLs in the href field is generally a bad idea (and note the lowercase j!). Using onclick as in my original example is much better. > I am using NB 6.5 for Ruby/Rails. Irrelevant unless that's what you're using as a Web browser as well as an IDE. Is that the case? [...] > > Ken Best, -- Marnen Laibow-Koser [email protected] http://www.marnen.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

