Jmol handles this by POSTing the request, not GETting it:

FileManager.getAtomSetCollectionFromFile(
http://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/smiles/SDF?record_type=3d?POST?smiles=C/C=C/C
)
FileManager.getAtomSetCollectionFromFile(
http://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/smiles/SDF?record_type=3d?POST?smiles=C/C=C\C
)

?POST? here is just a flag to JSmol to use the POST method. It doesn't
actually work in the above link.




On Fri, Mar 7, 2014 at 1:31 PM, Otis Rothenberger <[email protected]>wrote:

> Bob,
>
> I guess you missed it. I pointed out a similar problem with Safari last
> week or early this week. I put this in a note with my response to you about
> SJmol speed. I should have started a new email chain.
>
> The response type is not the only thing that's changed at PubChem. SMILES
> queries with \ seem to be broken even if url escaped. I did not report this
> because I'm still trying to make sure it's not an issue with my server.
>
> I should note that the PubChem name search works for me on Safari when I
> have my server relay the file after a server read. I assumed this was a new
> cross domain issue. After your note, this may well work because I change
> the response type before I send it from the server - i.e. unrelated to
> cross domain.
>
> Otis
>
>
> --
> Otis Rothenberger
> [email protected]
> http://chemagic.com
>
>
>
>
> On Mar 7, 2014, at 12:42 PM, Robert Hanson <[email protected]> wrote:
>
> I could swear this was working yesterday, so I think it is quite new.
> Something has changed at PubChem or with Firefox. I don't think it is
> Firefox, because I downgraded to FF 26.0 temporarily, and the problem
> persists.
>
> *Problem:* JSmol/HTML5 cannot download PubChem SDF files.
>
> *Configuration: *Firefox 27.0.1/Windows 8
>
> *Example:* http://chemapps.stolaf.edu/jmol/jsmol/jsmol.htm -- click on 
> *:caffeine
> *link
>
> *Observation 1: *JSmol reports "unrecognized file format"
> *Observation 2:* No problem in MSIE or Chrome
> *Observation 3: *Same problem local or website
> *Observation 4:* Same problem with older, stable version of Jmol at
> http://chemapps.stolaf.edu/jmol/jsmol-2014-01-24/jsmol.htm
>
> *Observation 5:* The following simple direct AJAX call fails under the
> exact same conditions as above:
>
> alert($.ajax({"dataType":"text","async":false,"type":"GET","url":"
> http://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/caffeine/SDF?record_type=3d
> "}).responseText)
>
> *Observation 6:* The following simple AJAX call
>
> alert($.ajax({"dataType":"text","async":false,"type":"GET","url":"
> http://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/caffeine/SDF?record_type=3d
> "}).statusText)
>
> reports "OK" in other browsers but
>
> [Exception... "Failure"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"
> location: "JS frame ::
> file:///C:/jmol-dev/workspace/JSmol/site/jsmol/jquery/jquery.js :: .send
> :: line 8707"  data: no]
>
> in Firefox.
>
> *Observation 7:*
> The following simple AJAX calls to a similar site work fine:
>
> alert($.ajax({"dataType":"text","async":false,"type":"GET","url":"
> http://cactus.nci.nih.gov/chemical/structure/caffeine/file?format=sdf&get3d=True
> "}).responseText)
>
> alert($.ajax({"dataType":"text","async":false,"type":"GET","url":"
> http://cactus.nci.nih.gov/chemical/structure/caffeine/file?format=sdf&get3d=True
> "}).statusText)
>
> The difference appears to be that PubChem is returning data with response
> type of chemical/x-mdl-sdfile, which forces a special download, as with
> PDF.
>
>
> Comments welcome.
>
> Bob
>
> --
> Robert M. Hanson
> Larson-Anderson Professor of Chemistry
> St. Olaf College
> Northfield, MN
> http://www.stolaf.edu/people/hansonr
>
>
> If nature does not answer first what we want,
> it is better to take what answer we get.
>
> -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
>
> ------------------------------------------------------------------------------
> Subversion Kills Productivity. Get off Subversion & Make the Move to
> Perforce.
> With Perforce, you get hassle-free workflows. Merge that actually works.
> Faster operations. Version large binaries.  Built-in WAN optimization and
> the
> freedom to use Git, Perforce or both. Make the move to Perforce.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk_______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
>
>
> ------------------------------------------------------------------------------
> Subversion Kills Productivity. Get off Subversion & Make the Move to
> Perforce.
> With Perforce, you get hassle-free workflows. Merge that actually works.
> Faster operations. Version large binaries.  Built-in WAN optimization and
> the
> freedom to use Git, Perforce or both. Make the move to Perforce.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>


-- 
Robert M. Hanson
Larson-Anderson Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to