On Wed, Aug 25, 2010 at 10:32 AM, Otis Rothenberger
<[email protected]>wrote:
> Bob,
>
> I'm working on this now, and I picked up on the fact that I would not be
> translating XML. I set this to "", but I'll remove the whole thing per
> your suggestion.
>
> I've used something like this before, but I used a "GET." A query string
> is in your "POST," so everything is there. The main thing is it works
> like a charm! What is true in:
>
> req.open("POST", url + "?" + data, true) ???
>
http://msdn.microsoft.com/en-us/library/ms536648%28VS.85%29.aspx
Looks like it is the asynchronous flag. You need that to be true, otherwise
the browser hangs.
>
> Originally, my NIH data was in a form field (readable via DOM/iFrames),
> and your code returns the whole page html. I need to change the dynamic
> page to return NIH text only.
>
Exactly.
>
> Otis Rothenberger
> chemagic.com
>
>
> On 8/25/2010 11:01 AM, Robert Hanson wrote:
> > Otis, that should read as follows. The xmlProcessor business was for a
> > page I had that actually did get XML return, but you won't have that,
> > I think. Truly, this is all there is to AJAX!
> >
> > var req = null
> > var isMSIE = false
> >
> > function loadXmlData(url, data) {
> > try {
> > if (window.XMLHttpRequest) { // native XMLHttpRequest object
> > req = new XMLHttpRequest();
> > } else { // IE/Windows ActiveX version
> > isMSIE = true
> > req = new ActiveXObject("Microsoft.XMLHTTP");
> > }
> > req.onreadystatechange = processStateChange;
> > req.open("POST", url + "?" + data, true);
> > req.setRequestHeader('Content-Type',
> > 'application/x-www-form-urlencoded; charset=UTF-8');
> > req.send(data);
> > } catch (e) {
> > alert(e);
> > }
> > }
> >
> >
> > function processStateChange() {
> > if (req.readyState != 4)
> > return
> > if (req.status != 200) {
> > alert(req.statusText);
> > return
> > }
> > [do something with req.responseText]
> > }
> >
> >
> >
> >
>
>
>
>
> ------------------------------------------------------------------------------
> Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
> Be part of this innovative community and reach millions of netbook users
> worldwide. Take advantage of special opportunities to increase revenue and
> speed time-to-market. Join now, and jumpstart your future.
> http://p.sf.net/sfu/intel-atom-d2d
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107
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
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users
worldwide. Take advantage of special opportunities to increase revenue and
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users