Topic: AJAX browser compatibility?

Hey all,

Recently I've begun adding some ajax elements to my projects and it's turning out to be pretty easy going so far.

I'm just wondering is there some sort of list with an overview of compatible browers some place? I've noticed none of the (very simple) functions I've used so far are working in Safari.

-- marsvin

Re: AJAX browser compatibility?

I haven't heard of any issues people have been having. Usually most issues with cross-browsers comes with display and css. Java/ajax things have been really based off what java clients the user has.

i'll keep ya posted if i do hear of anything -- but nothing so far as i know yet.

matthewvb

Re: AJAX browser compatibility?

Safari should be fully compatible. At least I haven't had any problems with it. Can you post the code which isn't working?

Railscasts - Free Ruby on Rails Screencasts

Re: AJAX browser compatibility?

If you are forging your own path and writing your own AJAX code, then its up to you to make sure you're compatible with all browsers. If you are sticking with prototype, scriptaculous and rails (rjs), then the compatibility issues are almost entirely (if not 100%) resolved for you already.

Re: AJAX browser compatibility?

I'm not that great with Javascript so I haven't tried going it alone wink Reason I figured it was Safari's fault was because it works perfectly in Firefox and IE..

Basically I'm reusing the partial I was already using to display an image related to the project like this:

# In the view
<div id="container_<%= project.safe_name %>">
  <%= render :partial => 'project_image', :locals => { :project => project, :id => 0 } %>
</div>

# In the partial
<%= link_to_remote image_tag(images[id], :width => 300 ),
                   :url => { :action => :show_pic, :project => project.id, :id => nxt },
                   :update => "container_#{project.safe_name}" %>

# And in the controller
def show_pic
  render :partial => 'project_image',
         :locals => { :id => params[:id].to_i, :project => Project.find(params[:project].to_i) }
end

I skipped some of the lines that check whether the requested picture id is unavailable and so on but that's all server-side.

Re: AJAX browser compatibility?

marsvin wrote:

I skipped some of the lines that check whether the requested picture id is unavailable and so on but that's all server-side.

Are you doing "puts" or "print" to determine this? If so, it is likely what is causing the problem.

Railscasts - Free Ruby on Rails Screencasts

Re: AJAX browser compatibility?

Neither, I think I explained wrong.. Here's roughly what I meant:

def show_pic

  # Find the requested project information or default to the first project available
  project = Project.find params[:project].to_i
  project = Project.find :first if project.nil?

  # Cast the picture id to an int and make sure it's in range
  id = params[:id].to_i % project.images.size

  # Render output
  render :partial etc...
end


(Don't have the code at hand at the moment but that's roughly what the controller does)

Re: AJAX browser compatibility?

I just figured out I have an outdated version of Safari to test with apparently. The mac I have access to is still running osx 10.3.0 and Safari 1.1. It won't let me upgrade either. So presumably it's just a case of outdated browser software.