0

Im having trouble working grabbing a dynamically created image from this service:

http://opsin.ch.cam.ac.uk/opsin/USER-STRUCTURE-TO-GENERATE.png

Im trying to use the same thing in a wordpress site with calls to this server but unsure on a solution.

Can anyone suggest a good way to go about making external calls to this service on the fly and return the image to my own site?

The method they use on their site is different and not compatible due to them hosting the java software on their own system.

Im sure the solution is quite simple im just not sure where to start looking exactly, JS is not my forty, yet.

1 Answer 1

0

The solution via jQuery seems to be something of the following.

Sadly there was other issues on the site to prevent it from working that I was unaware of when posting originally.

  $(document).ready(function() {
    $("#chemicalNameForm").submit(function(e)  {
        e.preventDefault();
        var chemicalName = $("#chemicalName").val();
        var url = "http://opsin.ch.cam.ac.uk/opsin/" + chemicalName + ".png";
        $('#results').show();
        $("#depiction").attr("src", url);
    })

});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.