IC SunsetThe developerWorks Connections platform will be sunset on December 31, 2019. On January 1, 2020, this forum will no longer be available. More details available on our FAQ.
Topic
  • 5 replies
  • Latest Post - ‏2014-09-20T11:17:00Z by jitupkp
PhillipM.Feldman
PhillipM.Feldman
3 Posts

Pinned topic open('GET') appears to do nothing

‏2013-05-24T05:32:51Z | ajax get open

I've created an online game (variant of hangman). The URL is as follows:

http://phillipmfeldman.org/English/hangman.html

In the beta version, at http://phillipmfeldman.org/English/hangman.html, I'm attempting to use open('GET') to query the server so that the number of solutions will be displayed. My JavaScript/AJAX code looks like this:

/* Query server to determine number of solutions and update the field that displays this information: */
xmlhttp= new XMLHttpRequest();
xmlhttp.onreadystatechange= function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("N_solutions").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open('GET', '../cgi-bin/test.py', true);
xmlhttp.send();

In the above, I'm calling a 3-line test Python script (at http://phillipmfeldman.org/cgi-bin/test.py) rather than the actual solver. It appears that nothing is being received from the server. Any suggestions as to what I'm doing wrong will be appreciated.

Phillip

  • PhillipM.Feldman
    PhillipM.Feldman
    3 Posts
    ACCEPTED ANSWER

    Re: open('GET') appears to do nothing

    ‏2013-06-16T04:28:06Z  

    I ended up using jquery.  It is more straightforward, and even better, it works.

  • PhillipM.Feldman
    PhillipM.Feldman
    3 Posts

    Re: open('GET') appears to do nothing

    ‏2013-06-16T04:27:48Z  

    I ended up using jquery.  It is more straightforward, and even better, it works.

  • PhillipM.Feldman
    PhillipM.Feldman
    3 Posts

    Re: open('GET') appears to do nothing

    ‏2013-06-16T04:28:06Z  

    I ended up using jquery.  It is more straightforward, and even better, it works.

  • jitupkp
    jitupkp
    104 Posts

    Re: open('GET') appears to do nothing

    ‏2014-09-20T11:15:17Z  

    see more

    http://techgurulab.com/course/ajax-quiz-online/

  • jitupkp
    jitupkp
    104 Posts

    Re: open('GET') appears to do nothing

    ‏2014-09-20T11:16:01Z  

    I ended up using jquery.  It is more straightforward, and even better, it works.

    see more

    http://techgurulab.com/course/ajax-quiz-online/

  • jitupkp
    jitupkp
    104 Posts

    Re: open('GET') appears to do nothing

    ‏2014-09-20T11:17:00Z  

    I ended up using jquery.  It is more straightforward, and even better, it works.

    see more

    http://techgurulab.com/course/ajax-quiz-online/