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)  ???

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.

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

Reply via email to