Error: Unknown runtime error in ie while using ajax

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vjayis
    New Member
    • Mar 2008
    • 134

    #16
    Originally posted by acoder
    Yes, it can. You may need to watch the case - see if this link helps.


    Hi

    probably i had also used the same script in my page., but when i click the ajax link in my page., it displays the alert message "ur browser does not support ajax"

    Here is my code:

    Code:
    <script type="text/javascript">
    var id;
    var action;
    function httprequest(id,action)
    {
    
    var xmlhttp;
    try
    {
     xmlhttp=new XMLHttpRequest();
    }
    catch(e)
    {
      try
      {
      xmlhttp=new Activexobject("Msxml2.XMLHTTP");
      }
      catch(e)
      { 
        try
    	{
        xmlhttp=new Activexobject("MICROSOFT.XMLHTTP")
    	}
    	catch(e)
    	{
    	 alert("ur browser doesnot support Ajax");
    	 return false;
    	}
      }
      
    }
    xmlhttp.onreadystatechange=function()
    { 
     if(xmlhttp.readyState==4)
     { 
     
       document.getElementById("ajax").innerHTML=xmlhttp.responseText;
       
     }
    }
    
    xmlhttp.open("GET","ajax.php?id="+id+"&action="+action,true);
    xmlhttp.send(null);
    }
    
    function hidden(id,action)
    {
     httprequest(id,action)
    }
    </script>
    [code=php]
    <div id="ajax">
    <table >
    <tr>
    <td>------Place where i fetch data from another page and display---------</td>
    <td><a onclick="hidden ('10','next')"> next</a></td>
    </tr>
    </table>
    </div>
    [/code]

    and in my ajax.php page i hav displayed datas fetched from database which are above the id(10) i sent on onclick event;

    but when i click the ajax(next) link., i get an alert message
    "ur browser doesnot support Ajax"
    in ie5 and ie6;
    but its working well with ie7 and firefox.,

    and i had even tried changing the id name from "ajax" to someother string., but nothing happened.,

    could u help me to get rid of the problem.,

    kind regards
    vijay

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #17
      You've made the same mistake. Remember JavaScript is case-sensitive.

      Activexobject should be ActiveXObject.

      What I suggest is that you copy the code from the linked page and then try that.

      The reason why it works in IE7/Firefox is that they both support the XMLHttpRequest object.

      Comment

      • vjayis
        New Member
        • Mar 2008
        • 134

        #18
        Originally posted by acoder
        You've made the same mistake. Remember JavaScript is case-sensitive.

        Activexobject should be ActiveXObject.

        What I suggest is that you copy the code from the linked page and then try that.

        The reason why it works in IE7/Firefox is that they both support the XMLHttpRequest object.

        Hi

        thanx., got the solution.,

        ajax is working well in ie6.,

        but after the page gets loaded.,

        the status bar displays the message.,
        "error on page." does my javascript made some errors., ??

        could you help me in this

        regards

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #19
          Originally posted by vjayis
          but after the page gets loaded.,

          the status bar displays the message.,
          "error on page." does my javascript made some errors., ??
          Yes, you've got some errors. Double click the error icon and see what the error is.

          Comment

          • vjayis
            New Member
            • Mar 2008
            • 134

            #20
            Originally posted by acoder
            Yes, you've got some errors. Double click the error icon and see what the error is.

            Hi

            got the solution by finding the errors.,

            thanks
            regards
            vijay

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              #21
              No problem, glad it's all working.

              Comment

              Working...