AJAX coding help ("undefined"?)?

Discussion in 'Digital Media' started by alto, May 1, 2008.

  1. alto Guest

    I spaced out my code because Yahoo Answers automatically converts text into "..." if they're too long.

    function loadPage( url )
    var ajaxRequest;
    try { ajaxRequest = new XML Http Request (); }
    catch (e) {
    try { ajaxRequest = new ActiveXObject ("Msxml2. XMLHTTP"); }
    catch (e) {
    try { ajaxRequest = new ActiveXObject ("Microsoft. XMLHTTP"); }
    catch (e) {
    alert("Your browser does not support AJAX");
    return false;

    ajaxRequest. onreadystatechange = function() {
    if(ajaxRequest. readyState == 4){
    document. getElementById(" content"). innerHTML = ajaxRequest. reponseText;

    var theurl = "contents/" + url + ".php";
    ajaxRequest.open ("GET", theurl, true);


    Using AJAX, I am trying to load a page when the user clicks a link. However, instead of the content, the text "undefined" shows up.
  2. Similar Threads: AJAX coding
    Forum Title Date
    Digital Media Can I use AJAX to bleach my white clothes? Jul 26, 2008
    Digital Media what is the difference between Diomedes and Ajax? Jun 9, 2008
    Digital Media Is Ajax SEO friendly?? Jun 3, 2008
    Digital Media New to Ajax! Need help.? May 22, 2008
    Digital Media Where can i get free ajax controll toolkit to built asp.net application ? May 10, 2008
    Digital Media I used Ajax cleanser and I didn't wear any gloves because I was out of them.... May 9, 2008
    Digital Media How much does it cost to go bowling in Ajax Canada? May 9, 2008
    Digital Media what is javascript and ajax? May 8, 2008
    Digital Media does anyone have the book "ajax: the definitive guide" the o'reilly books? May 7, 2008
    Digital Media What is asp.net ajax and asp.net? May 3, 2008

Share This Page