Visualization Problem Google Chrome

User e22d9561fc

20-06-2014 16:40:21

I'm having a problem viewing 2d with the Chrome browser so I can see when I update using the address of the page f5 key is: http://www.ccae.ufpb.br/sistematx/sistematx/resultado.php?id=1035 in other browsers work perfectly

ChemAxon 7c2d26e5cf

23-06-2014 15:11:09

I have checked your example.


Indeed, sometimes the image does not display. In this case, you can find the following error message on the JavaScript console:


Uncaught TypeError: Cannot read property 'molToDataUrl' of undefined


The error is here in your code:


$(window).load(function() {
var settings = {};
var dataUrl = marvin.ImageExporter.molToDataUrl($("#molsource-box").val(), "image/png", settings);

In your example, the image generation is called immediately when page loading is finished. In this moment, there is no guaranty that marvin.ImageExporter is already ready.


Please, bind your code to the "ready" event of the "marvin" package instead of the load event of the browser.


marvin.onReady(function() {
var settings = {}; 
var dataUrl = marvin.ImageExporter.molToDataUrl($("#molsource-box").val(), "image/png", settings);
});

Please, see the following Marvin JS example where the above functionality is demonstrated: 
Display More Images Immediately