Forum: Ruby on Rails javascript momentarily displayed on screen?...

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
006a4831843b48f6102d5d3cf92ae283?d=identicon&s=25 Shilo Ayalon (gte351s)
on 2009-01-06 15:22
what could be a reason for my js to be displayed on the screen for a
second before it catches and does what it's supposed to? I've had this
happen when I call page.reload inside render :update block...

<%= link_to_remote 'reload',
                   :update => 'my_div',
                   :url => {:action => 'reload_page'} %>

def reload_page

  respond_to do |format|
    format.js do
      render(:update) do |page|
        page.reload
      end
    end
  end

end


yup, rails newb.
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-01-06 15:29
(Received via mailing list)
On 6 Jan 2009, at 14:22, Shilo Ayalon wrote:

>
> what could be a reason for my js to be displayed on the screen for a
> second before it catches and does what it's supposed to? I've had this
> happen when I call page.reload inside render :update block...
>
Don't pass :update to link_to_remote if you're using render :update

Fred
006a4831843b48f6102d5d3cf92ae283?d=identicon&s=25 Shilo Ayalon (gte351s)
on 2009-01-07 10:04
Frederick Cheung wrote:
> On 6 Jan 2009, at 14:22, Shilo Ayalon wrote:
>
>>
>> what could be a reason for my js to be displayed on the screen for a
>> second before it catches and does what it's supposed to? I've had this
>> happen when I call page.reload inside render :update block...
>>
> Don't pass :update to link_to_remote if you're using render :update
>
> Fred

Right, that was the problem. Thanks.
This topic is locked and can not be replied to.