Ticket #2887 (closed bug: invalid)
Mash-up issue with drag and drop and document.writeln
| Reported by: | michelled | Owned by: | paul |
|---|---|---|---|
| Priority: | major | Milestone: | 1.2.4 |
| Component: | ui | Version: | 1.2.3 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Dragging something with a 'document.writeln' in it causes the page to break. Here is an example: http://build.fluidproject.org/sakai-imagegallery-tool/tests/fluid-tests/manual/jQueryDnD/writeln.html
To replicate the issue, try to drag 'Item 1'.
I encountered this problem when using jQuery drag an drop in a learning management system that already contained some javascript. We wanted to drag sections of the page around to change the layout. One of the sections of the page had an existing script that contained a call to 'document.writeln'.
Attachments
Change History
comment:1 Changed 5 years ago by michelled
I've attached the example because it is being removed from the fluid project svn.
comment:2 Changed 5 years ago by Bosmon
This issue is caused by any <script> blocks present within the dragged material being re-evaluated on reattachment to the docuement - even if they had originally been evaluated. The only reasonable solution would seem to be to remove them from the node children on drag start in the drag manager.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

