{"action":"created","issue":{"url":"https://api.github.com/repos/tinymce/tinymce/issues/932","repository_url":"https://api.github.com/repos/tinymce/tinymce","labels_url":"https://api.github.com/repos/tinymce/tinymce/issues/932/labels{/name}","comments_url":"https://api.github.com/repos/tinymce/tinymce/issues/932/comments","events_url":"https://api.github.com/repos/tinymce/tinymce/issues/932/events","html_url":"https://github.com/tinymce/tinymce/issues/932","id":113928229,"number":932,"title":"Can not get val() of certain elements when jQuery tinymce (v4+) is loaded.","user":{"login":"TinyMCE-User","id":14879844,"avatar_url":"https://avatars1.githubusercontent.com/u/14879844?v=3","gravatar_id":"","url":"https://api.github.com/users/TinyMCE-User","html_url":"https://github.com/TinyMCE-User","followers_url":"https://api.github.com/users/TinyMCE-User/followers","following_url":"https://api.github.com/users/TinyMCE-User/following{/other_user}","gists_url":"https://api.github.com/users/TinyMCE-User/gists{/gist_id}","starred_url":"https://api.github.com/users/TinyMCE-User/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TinyMCE-User/subscriptions","organizations_url":"https://api.github.com/users/TinyMCE-User/orgs","repos_url":"https://api.github.com/users/TinyMCE-User/repos","events_url":"https://api.github.com/users/TinyMCE-User/events{/privacy}","received_events_url":"https://api.github.com/users/TinyMCE-User/received_events","type":"User","site_admin":false},"labels":[{"id":279311463,"url":"https://api.github.com/repos/tinymce/tinymce/labels/browser:%20chrome","name":"browser: chrome","color":"ededed","default":false},{"id":279311460,"url":"https://api.github.com/repos/tinymce/tinymce/labels/browser:%20firefox","name":"browser: firefox","color":"ededed","default":false},{"id":279311461,"url":"https://api.github.com/repos/tinymce/tinymce/labels/browser:%20ie","name":"browser: ie","color":"ededed","default":false},{"id":279311464,"url":"https://api.github.com/repos/tinymce/tinymce/labels/browser:%20opera","name":"browser: opera","color":"ededed","default":false},{"id":279311462,"url":"https://api.github.com/repos/tinymce/tinymce/labels/browser:%20safari","name":"browser: safari","color":"ededed","default":false},{"id":279311468,"url":"https://api.github.com/repos/tinymce/tinymce/labels/origin:%20tinymce.com","name":"origin: tinymce.com","color":"ededed","default":false},{"id":279311465,"url":"https://api.github.com/repos/tinymce/tinymce/labels/type:%20bug","name":"type: bug","color":"555555","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2013-07-30T01:51:03Z","updated_at":"2017-05-24T10:34:00Z","closed_at":"2017-05-24T10:34:00Z","body":"Description of problem:\n\nWhen there is an HTML element (eg. form input field) which has an ID that is the same as an existing javascript array prototype method or property, an error occurs when you try to access the jQuery setter/getter functions .text(), .html() or .val() on that element.\n\nThe tinymce jQuery plugin modifies jQuery's setters and getters (text, html, val) to add support for getting content from tinymce instances, however the tinymce.get() (tinymce.jquery.js:24987, called by jquery.tinymce.js:246) method is incorrectly returning a false positive for these fields, returning the javascript array method/property with the same name instead of a tinymce editor instance.\n\nBecause tinymce.editors is stored as an array, when it goes to return this.editors['sort'](which is not an editor instance), it's finding the sort() method as inherited from the array prototype. This can be solved by using hasOwnProperty() at this point to check that we're not returning inherited methods or properties from the prototype. eg if (this.editors.hasOwnProperty('sort'))\n\nSteps to reproduce:\n1. Have the jQuery version of tinymce running on a page. (Not sure if this is the same for the non-jQuery version)\n2. Try to access the value of a form input element with the ID attribute of \"sort\" using jQuery's .val() method. eg. \n\n&ltg;input type=\"hidden\" id=\"sort\" value=\"123\" />\n&ltg;script>\nconsole.log ( $(\"#sort\").val() );\n&ltg;/script>\n\nExpected result:\n\n123\n\nActual result:\n\nUncaught TypeError: Object function sort() { [native code] } has no method 'getContent' \n\n> _**Legacy information imported from TinyMCE bug tracker:**_\n> \n> _[#T6157](http://archive.tinymce.com/develop/bugtracker_view.php?id=6157) posted by [madwebskills](http://archive.tinymce.com/profile.php?name=madwebskills)_\n> \n> _**Tags:** [firefox msie safari chrome opera jquery val html text]_\n> _**Status:** Open_\n> _**Resolution:** None_\n> _**Attached URL:** http://fiddle.tinymce.com/Rtdaab_\n"},"comment":{"url":"https://api.github.com/repos/tinymce/tinymce/issues/comments/303685212","html_url":"https://github.com/tinymce/tinymce/issues/932#issuecomment-303685212","issue_url":"https://api.github.com/repos/tinymce/tinymce/issues/932","id":303685212,"user":{"login":"fyrkant","id":8655649,"avatar_url":"https://avatars0.githubusercontent.com/u/8655649?v=3","gravatar_id":"","url":"https://api.github.com/users/fyrkant","html_url":"https://github.com/fyrkant","followers_url":"https://api.github.com/users/fyrkant/followers","following_url":"https://api.github.com/users/fyrkant/following{/other_user}","gists_url":"https://api.github.com/users/fyrkant/gists{/gist_id}","starred_url":"https://api.github.com/users/fyrkant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fyrkant/subscriptions","organizations_url":"https://api.github.com/users/fyrkant/orgs","repos_url":"https://api.github.com/users/fyrkant/repos","events_url":"https://api.github.com/users/fyrkant/events{/privacy}","received_events_url":"https://api.github.com/users/fyrkant/received_events","type":"User","site_admin":false},"created_at":"2017-05-24T10:34:00Z","updated_at":"2017-05-24T10:34:00Z","body":"Closing this due to old age, if anyone still has this issue in the latest version of TinyMCE please open up a new issue. "}}
{"actor":{"display_login":"fyrkant"}}