Please help with div and sciptacolous

i cant seem to get the string conversion correct…any help would be
great!

<%if @viewobj != nil%>

<% for replay in @viewobj %>

<%= link_to_remote( “get description”,
:update => ‘desc_div’+replay.id.to_s,
:loaded => “new Effect.toggle(desc_div” +
replay.id.to_s + “)”,
:url =>{:action => :get_desc, :id => replay.id })%>

>

<%end%>

<%end%>

hi i got it to work with this…

by converting the div string

<% s = "

"%>
<%= s %>

now my next problem seems that i click once, the description appears and
then disappears, when click again, it works fine. any idea?

koloa wrote:

>

Try:

I moved your tick over. And this is better:

hi i got it to work with this…

by converting the div string

<% s = “

”%>
<%= s %>

And that creates (relatively) ill-formed HTML. I’m aware that HTML is
often
“anything goes”, but you don’t have quotes around the id=desc_div2. I
always
feel safer with id=‘desc_div2’, because many more things besides web
browsers should read my HTML.


Phlip
Redirecting... ← NOT a blog!!!

koloa wrote:

<%= link_to_remote( “get description”,
:update => ‘desc_div’+replay.id.to_s,
:loaded => “new Effect.toggle(desc_div” +
replay.id.to_s + “)”,

When programming the stack of languages we call The Web, you need to
keep
track of which language you are in at all times, at the level of all
symbols. When you type a Ruby string like “new Effect.toggle(desc_div)”,
it
passes to JavaScript as:

new Effect.toggle(desc_div)

JavaScript needs to see this:

new Effect.toggle(‘desc_div’)

Add more ’ ’ to your expression.


Phlip
Redirecting... ← NOT a blog!!!

hi Phlip, THANKS!