{"action":"created","issue":{"url":"https://api.github.com/repos/galetahub/ckeditor/issues/471","labels_url":"https://api.github.com/repos/galetahub/ckeditor/issues/471/labels{/name}","comments_url":"https://api.github.com/repos/galetahub/ckeditor/issues/471/comments","events_url":"https://api.github.com/repos/galetahub/ckeditor/issues/471/events","html_url":"https://github.com/galetahub/ckeditor/issues/471","id":39803065,"number":471,"title":"the latest version(4.1.0) got js error: The editor instance \"xxxx\" is already attached to the provided element","user":{"login":"leopoldchen","id":1396883,"avatar_url":"https://avatars.githubusercontent.com/u/1396883?v=3","gravatar_id":"","url":"https://api.github.com/users/leopoldchen","html_url":"https://github.com/leopoldchen","followers_url":"https://api.github.com/users/leopoldchen/followers","following_url":"https://api.github.com/users/leopoldchen/following{/other_user}","gists_url":"https://api.github.com/users/leopoldchen/gists{/gist_id}","starred_url":"https://api.github.com/users/leopoldchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leopoldchen/subscriptions","organizations_url":"https://api.github.com/users/leopoldchen/orgs","repos_url":"https://api.github.com/users/leopoldchen/repos","events_url":"https://api.github.com/users/leopoldchen/events{/privacy}","received_events_url":"https://api.github.com/users/leopoldchen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-08-08T08:38:11Z","updated_at":"2015-05-14T12:59:30Z","closed_at":null,"body":"4.0.11 and the previous version are all work very well. I check the code and find out the latest version add the below code to the /ckeditor / lib / ckeditor / utils.rb file\r\n\r\n```ruby\r\ndef js_replace(dom_id, options = nil)\r\n  ***\r\n  js << \"} else { setTimeout(arguments.callee, 50); } })();\" # seems like with this line, the code \"CKEDITOR.replace('***');\" will call twice?\r\n  ***\r\nend\r\n```"},"comment":{"url":"https://api.github.com/repos/galetahub/ckeditor/issues/comments/102028751","html_url":"https://github.com/galetahub/ckeditor/issues/471#issuecomment-102028751","issue_url":"https://api.github.com/repos/galetahub/ckeditor/issues/471","id":102028751,"user":{"login":"lemingos","id":95296,"avatar_url":"https://avatars.githubusercontent.com/u/95296?v=3","gravatar_id":"","url":"https://api.github.com/users/lemingos","html_url":"https://github.com/lemingos","followers_url":"https://api.github.com/users/lemingos/followers","following_url":"https://api.github.com/users/lemingos/following{/other_user}","gists_url":"https://api.github.com/users/lemingos/gists{/gist_id}","starred_url":"https://api.github.com/users/lemingos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lemingos/subscriptions","organizations_url":"https://api.github.com/users/lemingos/orgs","repos_url":"https://api.github.com/users/lemingos/repos","events_url":"https://api.github.com/users/lemingos/events{/privacy}","received_events_url":"https://api.github.com/users/lemingos/received_events","type":"User","site_admin":false},"created_at":"2015-05-14T12:59:30Z","updated_at":"2015-05-14T12:59:30Z","body":"```\r\n if options && !options.keys.empty?\r\n          js_options = ActiveSupport::JSON.encode(options)\r\n          js << \"if (CKEDITOR.instances['#{dom_id}'] == 'undefined') {CKEDITOR.replace('#{dom_id}', #{js_options});}\"\r\n        else\r\n          js << \"if (CKEDITOR.instances['#{dom_id}'] == 'undefined') {CKEDITOR.replace('#{dom_id}');}\"\r\n        end\r\n```\r\nworks for me"}}