Archive for the ‘RJS’ Category

Friday, July 20th, 2007

Interesting - a plugin for Rails that uses Flash to push messages to the client (instead of using polling, as Campfire does). I’ve not looked at this at all but I’m sure, if it works, it could be very very useful.

Friday, April 13th, 2007

I happilly deployed the latest version of my application to our test server last night and posted a message saying “here it is - please test away”

I come in to work this morning and see a mail saying “when you click lots of the links you get an RJS error”. Weird - I fire up Safari and it works fine. I fire up Internet Explorer 7 - RJS errror. But only on some of the links. I try a different machine with IE6. Same thing. Try in Firefox. All OK.

After lots of wasted time I find out what the problem is. I have this in my page:

  <p id=”new_staff_assignment”>   <%= link_to_remove ‘assign a new staff member’, :url => new_staff_assignment_path, :before => show_progress_indicator, :complete => hide_progress_indicator %>   </p>

which fires the following bit of RJS:

  page.replace_html ‘new_staff_assignment’, :partial => ‘new’  page.visual_effect :highlight, ‘new_staff_assignment’

As I say - works fine in Safari/Camino/Firefox but not in IE6 or IE7.

But then I changed my page to:

  <div id=”new_staff_assignment”>  <%= link_to_remove ‘assign a new staff member’, :url => new_staff_assignment_path, :before => show_progress_indicator, :complete => hide_progress_indicator %>   </div>

and what do you know? It works fine.

I guess a P tag doesn’t have an innerHtml property whereas a div does.