User 873a9ae9d0
03-02-2014 19:13:41
HI,
In my asp.net app I have a form with an iframe that is a container for M4J.
By certain reasons I do not want in my Javascript code use getMarvinPromise to access the editor.
The main reason is that getMarvinPromise is using an async pattern that is giving me problems.
Now I tried to access the editor as outlined in the 'Marvin for Javascript - How to embed it' doc.
This is my code:
var marvinSketcherInstance;
var s="Themolfile";
var eframeWin = document.getElementById("MyIframeID").contentWindow;
var marvin = eframeWin.marvin;
marvin.onReady(function () {
if (typeof marvin.Sketch != 'undefined') {
marvinSketcherInstance = marvin.Sketch;
marvinSketcherInstance.importAsMol(s);
....
marvinSketcherInstance seems to be defined, but the call to ImportAsMol(s) does nothing. I tried other methods such as isEmpty too. Same result.
What am I doing wrong ???
BTW: There seems to be a documentation error in the mentioned document. In the doc marvin.sketch is used. I assume it should mean marvin.Sketch.
Hope one can help . Any help is highly appreciated.
regards
Hans-Juergen
AKos GmbH