Skip to main content

Search and Top Navigation

#6951 closed bug (wontfix)

Opened February 07, 2011 01:31PM UTC

Closed October 31, 2012 12:16AM UTC

Inline script executing on FIRST drop.

Reported by: santhoshs Owned by:
Priority: minor Milestone: 2.0.0
Component: ui.sortable Version: 1.8.7
Keywords: Cc:
Blocked by: Blocking:
Description

I have a test page with simple drag and drop between two list. The issue is when I try to drag and drop "item 4" the inline script given inside LI will execute on FIRST drop. If I drag and drop for the SECOND time the inline Javascript will not execute.

Here is a sample test page http://jsfiddle.net/39ZvN/16/

On page load you can see a alert message. After that try to drag "item 4" for the first time you will see a alert message. If you try it again you will not see the alert.

Issue is Inline javascript is executing only on first drag.

Please provide solution ASAP.

Using Jquery 1.4.4 and UI Sortable 1.8.7

Attachments (0)
Change History (3)

Changed January 13, 2012 10:58PM UTC by Flint Makal comment:1

_comment0: I sent a pull request to fix this. \ \ https://github.com/jquery/jquery-ui/pull/572 \ \ Problem is that $.before() function that is used to append the sorted element, trigger an eval of the script (execute it) and then remove the <script> tag. \ I changed this to pure javascript insertBefore() to avoid the javascript to be executed. \ \ PS : please avoid using ASAP word, if you are in a hurry, maybe try working on it ?1333631710305422

I sent a pull request to fix this.

https://github.com/jquery/jquery-ui/pull/572

Problem is that $.before() function that is used to append the sorted element, trigger an eval of the script (execute it) and then remove the <script> tag.

I changed this to pure javascript insertBefore() to avoid the javascript to be executed.

Changed October 11, 2012 02:54PM UTC by scottgonzalez comment:2

milestone: 1.9.02.0.0

Changed October 31, 2012 12:16AM UTC by mikesherov comment:3

resolution: → wontfix
status: newclosed

Thanks for contributing! This issue is going to be resolved in jQuery core in 1.9 here: http://bugs.jquery.com/ticket/11795 for that reason, I'm resolving this as wontfix as we won't be fixing this in jQuery UI.