Sortable - Crash - JavaScript Inside Portlet

Sortable - Crash - JavaScript Inside Portlet

Hi,
 
When I place JavaScript code that outputs some content inside a Sortable Portlet and drag it, Firefox and Safari re-loads a blank page with just the JavaScript output.
 
Are there any known issues about placing JavaScript inside Sortable, Draggabe or Droppable DIVS?
 
Thanks,
 
James