Re: [Jmol-users] Find/chemical

2017-06-28 Thread Robert Hanson
thanks, that is good to know.
​
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Find/chemical

2017-06-28 Thread Otis Rothenberger
Bob,

You can do it with jQuery. This is just a quick hit for methane to see if 
cactus is down. The error t is the string “timeout”...

function ckInchiResolver() {
if (!isOnline()) {
resolverOnline = false;
return null;
}
$.ajax({
url: Resolver + "C/stdinchi",
success: function(data){
resolverOnline = true;
},
error: function(x, t, m) {
resolverOnline = false;
},
timeout: 5000
});
return null;
}

Resolver above is a string variable for cactus. It’s a variable because I 
change InChI Resolvers.

SideNote: JSME now has an InChI resolver. To use it you have to fire the event 
in the JSME interface. I guess there’s a way to fire this event in JavaScript, 
but I can’t figure it out. I’m still using the InChI app you have in Jmol as a 
back-up InChI resolver using the app in a separate tab - the cross tab 
communication seems to work just fine when I need a back-up InChI resolver. I 
could add this resolver app  to my Model Kit page, but the app is almost a 
megabyte in size.

Otis

--
Otis Rothenberger
o...@chemagic.org
http://chemagic.org

> On Jun 28, 2017, at 12:12 AM, Robert Hanson  wrote:
> 
> I don't believe you can set the timeout for an AJAX call in a browser. Can 
> you? If so, we're not doing that but probably should. It's probably 60 
> seconds. You can do that with PHP, I know...
> 
> Bob
> ​
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! 
> http://sdm.link/slashdot___
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Find/chemical

2017-06-27 Thread Robert Hanson
I don't believe you can set the timeout for an AJAX call in a browser. Can
you? If so, we're not doing that but probably should. It's probably 60
seconds. You can do that with PHP, I know...

Bob
​
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


[Jmol-users] Find/chemical

2017-06-27 Thread Otis Rothenberger
Bob,

I assume calls like this

{*}.find("chemical","stdinchi”)

are using Ajax to Resolver. I see that I can catch a 404 error form this .find, 
but I’m wondering about a timeout. Do you have a timeout set in your Ajax call? 
If so, what’s the text response?

Otis


--
Otis Rothenberger
o...@chemagic.org
http://chemagic.org

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users