Jquery mobile update div tag


I’m hoping there’s Rails developers who are working with jquery mobile
can help me out with this simple thing. I’m trying to update a div on a
page with an Ajax call and it doesn’t work. If I call jquery directly
the browser, the div gets updated. However, if I call it through a
call, the div remains unchanged. Here’s my code:

<%= link_to foobar_url, :remote => true, :method => :put, 'data-ajax' => 'false' do %>click<% end %>
def foobar respond_to do |format| format.mobile { render :layout => false } end end $('.mydiv').html('world'); // in foobar.mobile.erb

I don’t understand jquery that well, let alone jquery mobile. I tried
adding .page() and .trigger(‘create’) like I’ve found on some posts, but
that didn’t do anything. Also, I made sure that the cache tag was not



Can you post error your getting that will help you where exactly error
And Instead of link have you tried simple Ajax call like $.ajax() .

Thanks for replying. There is no error. The Ajax content is sent back to
the browser but it doens’t get executed. What exactly is the simple Ajax
call syntax?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs