2012-08-30 16:16 Europe/Helsinki: Robert Hanson:
> You  won't be able to load binary data into Jmol using any script command.
> Sorry. This won't work with .jmol files.
> 
> So basically you have the problem that Java itself can't load the file as a
> script, and the file is binary. Right?

This is correct. I need the browser to download the file instead of Java
applet trying to do that by itself.

> I can probably do something  about that. As long as the binary data is
> mappable to Java byte[]
> I'll get back to you with a test tonight or tomorrow. I think it should be
> possible, but it's going to be rather tricky.

OK. In the demo "demo-ajax-load-jmol.html" you can change start of the
function httpGet(url, vars, callbackFunction) to read

var request = getXmlHttpRequest();
        request.open("GET", url, true); // async
        request.responseType = "text";
        request.overrideMimeType("application/octet-stream");
        request.onreadystatechange = function()
        {

Where responseType is set to "text", "blob", "document" or "arraybuffer"
(see documentation at
https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest for more
details) to see if it gets the data in more appropriate format.
Currently anything else but "text" (default) causes "Error: Error
calling method on NPObject." in Google Chrome and in Firefox, I get
following error (with "arraybuffer"):

java.lang.IllegalArgumentException: No method found matching name
loadInlineArray and arguments
[sun.plugin2.main.client.MessagePassingJSObject, java.lang.String,
java.lang.Boolean]

It would be great if you can get binary loading to work. If this ends up
being unsupported, I just need to know it for sure before I start
working with some kind of workaround.

-- 
Mikko


Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to