Drag and drop replace html


#1

I have this:
<%= drop_receiving_element :slot2, {:onDrop => “function(element) {
$(‘slot2’).replace(’

+ element + ’ ).addClassName
(‘cardfill’); }”} %>

I am trying to replace the data ina table but when I try this it
complains a saying it is looking for a ‘}’ at “slot2”

According to the prototype docs this should be the correct syntax.
Anyone know how to do this?


#2

On Nov 26, 1:44 am, Me removed_email_address@domain.invalid wrote:

I have this:
<%= drop_receiving_element :slot2, {:onDrop => “function(element) {
$(‘slot2’).replace(’

+ element + ’ ).addClassName
(‘cardfill’); }”} %>

I am trying to replace the data ina table but when I try this it
complains a saying it is looking for a ‘}’ at “slot2”

According to the prototype docs this should be the correct syntax.
Anyone know how to do this?

You need to escape those " in the string :slight_smile:

Fred