Search code examples
jqueryruby-on-railsprototypejsfacebox

jquery to prototype format question


I'm currently using the facebox_render plugin for rails, and am trying to get it working without jquery (so using prototype). I've got it 99% functional, but there's one line I'm having difficulty with.

how would I write the following using prototype?

link_to_function(name, "jQuery.facebox(function(){ #{remote_function(options)} })", html_options || options.delete(:html))

I'm not familiar with prototype, so chances are there's a really simple solution :P

It's the jQuery.facebox(function() ... ) bit that's causing me grief.


Solution

  • Facebox is a plugin that depends on jQuery. That is, it depends on jQuery being loaded to work. To use Facebox, you need to load jQuery.

    Try using the PrototypeJS port of Facebox, see: Porting Facebox from jQuery to Prototype