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 <hans...@stolaf.edu> 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

Reply via email to