Categories

See More
Popular Forum

MBA (4887) B.Tech (1769) Engineering (1486) Class 12 (1030) Study Abroad (1004) Computer Science and Engineering (988) Business Management Studies (865) BBA (846) Diploma (746) CAT (651) B.Com (648) B.Sc (643) JEE Mains (618) Mechanical Engineering (574) Exam (525) India (462) Career (452) All Time Q&A (439) Mass Communication (427) BCA (417) Science (384) Computers & IT (Non-Engg) (383) Medicine & Health Sciences (381) Hotel Management (373) Civil Engineering (353) MCA (349) Tuteehub Top Questions (348) Distance (340) Colleges in India (334)
See More

I am trying to implement the ajax technology but unable to find whats the problem

General Tech Technology & Software
Max. 2000 characters
Replies

usr_profile.png
Katie George

User

( 3 months ago )

 

I am trying to implement ajax technology but whats the problem I am not getting please help me to identify the problem to identify the problem.
I think the problem is on the this page.

 <html>
 <body>
  <script language = "javascript" type = "text/javascript">
     //Browser Support Code
     function ajaxFunction() {
        var ajaxRequest;

        try {        
           // Opera 8.0+, Firefox, Safari
           ajaxRequest = new XMLHttpRequest();
        } catch (e) {

           // Internet Explorer Browsers
           try {
              ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
           } catch (e) {

              try {
                 ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
              } catch (e) {
                 // Something went wrong
                 alert("Your browser broke!");
                 return false;
              }
           }
        }

        // Create a function that will receive data
        // sent from the server and will update
        // div section in the same page.
        ajaxRequest.onreadystatechange = function() {

           if(ajaxRequest.readyState == 4) {
              var ajaxDisplay = document.getElementById('ajaxDiv');
              ajaxDisplay.innerHTML = ajaxRequest.responseText;
           }
        }

        // Now get the value from user and pass it to
        // server script.
        var age = document.getElementById('age').value;
        var wpm = document.getElementById('wpm').value;
        var sex = document.getElementById('sex').value;
        var queryString = "&age = " + age ;

        queryString +=  "&wpm = " + wpm + "&sex = " + sex;
        ajaxRequest.open("GET", "http://localhost/ajax-example.php" + 
  queryString, true);
        ajaxRequest.send();
     }
  </script>

  <form name = 'myForm'>
     Max Age: <input type = 'text' id = 'age' /> <br />
     Max WPM: <input type = 'text' id = 'wpm' /> <br />
     Sex: 

     <select id = 'sex'>
        <option value = "m">m</option>
        <option value = "f">f</option>
     </select>

     
			
        

what's your interest