I’m looking for a way to get a value (CodeMirror-instance) which is stored using jQuery’s .data()-method from outside the document-context it was stored from.
My case is I have a jQuery-dialog with a CodeMirror-instance. I’m trying to create an ajax-save function but when the converted textarea is submitted, CodeMirror provides a callbackfunction which puts the current content to the textarea again.
I need the stored instance of CodeMirror from .data() to perform the callback manual so I can start processing the contents. Can this be achieved? And if so, how?
I’ve fixed my problem using an AJAX-save solution, therefore I didn’t need to access the object anymore.