prototype: using Ajax.Updater does not apply styles

2 views
Skip to first unread message

michal

unread,
Mar 16, 2007, 10:38:31 AM3/16/07
to Ruby on Rails: Spinoffs
hi guys,
i have a question regarding prototype and the Ajax.Updater.
When the requested page contains <style> definitions they are not
applied after the update. Seems logic to me because the styles are
loaded when the page was rendered.
Do you know a way of how to apply the styles again ..
thanks!

Justin Perkins

unread,
Mar 16, 2007, 10:50:26 AM3/16/07
to rubyonrail...@googlegroups.com
Have you used an inspector type tool (like Firebug) to verify that
your markup is correct and corresponds the CSS you are expecting?

-justin

Colin Mollenhour

unread,
Mar 16, 2007, 7:48:05 PM3/16/07
to rubyonrail...@googlegroups.com
Technically, style tags belong in the <head>, I wouldn't be surprised if
they didn't work when inserted into the body.

Colin

Phlip

unread,
Mar 16, 2007, 9:28:39 PM3/16/07
to rubyonrail...@googlegroups.com
Colin Mollenhour wrote:

> Technically, style tags belong in the <head>, I wouldn't be surprised if
> they didn't work when inserted into the body.

That's how the Rails auto_complete_thingy works; it inserts the same <style>
block before each auto-complete field.

(No, guys, if Rails just jumped off a cliff I wouldn't follow. ;-)

--
Phlip
http://www.greencheese.us/ZeekLand <-- NOT a blog!!!

David Dashifen Kees

unread,
Mar 17, 2007, 1:36:37 PM3/17/07
to rubyonrail...@googlegroups.com
Style tags can be anywhere they need to be, even though they're supposed to be in the <head> of the document.  And as long as they're available at page load, then things'll work fine.  I'm not sure how to load them via ajax and apply them, though. 

 -- Dash --

michal

unread,
Mar 28, 2007, 2:24:29 PM3/28/07
to Ruby on Rails: Spinoffs
hey guys thanks for your replies. i know i am a little late but i had
no time yet.
my problem still exists and i wonder if it is somehow possible to
apply styles after i bunged in some HTML (incl style-block) with ajax
into my page.

@justin: the styles are correct and work fine. if I bung them into the
calling page then everything works fine...

Ecke

unread,
May 24, 2007, 8:15:57 AM5/24/07
to Ruby on Rails: Spinoffs
Check out the following page for more info on how to solve this
problem

http://dev.rubyonrails.org/ticket/8282

On Mar 28, 7:24 pm, "michal" <mga...@gmail.com> wrote:
> hey guys thanks for your replies. i know i am a little late but i had
> no time yet.
> my problem still exists and i wonder if it is somehow possible to

> apply styles after i bunged in some HTML (inclstyle-block) with ajax

Reply all
Reply to author
Forward
0 new messages