Topic
3 replies Latest Post - ‏2014-09-20T11:42:47Z by jitupkp
vn412
vn412
2 Posts
ACCEPTED ANSWER

Pinned topic unknown runtime error in IE when dynamically populating select box

‏2012-03-01T12:53:39Z |
Hi,

I m populating 2 select boxes country & city dynamically using ajax. All is working fine in mozilla & all but not in IE. but when i change country according to it city select box doesn't get populated in IE.
<td width="60%" align="right">Country : <?=PopulateSelect('country1',"SELECT * FROM tblname order by cname",1,"Country");?> City : <?=PopulateSelect('city1',"select cityid,cityname from city where countryid=1 order by cityname",0);?></td>
Any help in this matter will be highly appreciated.
Thanks in advance
Updated on 2012-03-01T13:32:55Z at 2012-03-01T13:32:55Z by vn412
  • vn412
    vn412
    2 Posts
    ACCEPTED ANSWER

    Re: unknown runtime error in IE when dynamically populating select box

    ‏2012-03-01T13:32:55Z  in response to vn412
    I m getting blank selectbox in IE. Error is
    "UnKnown runtime error" in js file
    Here is js file code
    JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)

    function Ajax_init() {
    this.GetData= function (val,id,p,load)
    {
    var ctrl=null;
    var d=new Date();
    var timestamp=d.getMinutes()+'_'+d.getSeconds()+'_'+d.getMilliseconds();
    var xmlHttp=GetXmlHttpObject()

    if(p==null)
    p=1;
    if(load==null)
    load=1;
    if (xmlHttp==null)

    {

    alert ("Browser does not support HTTP Request")

    return

    }
    ctrl=document.getElementById(id);
    if(load==1)
    ctrl.innerHTML="";
    xmlHttp.onreadystatechange=function() { HandleGetData(id,xmlHttp); }
    xmlHttp.open("GET", 'AjaxPage.php?q='+val+'&page='+p+'&order='+document.getElementById('hdnorder').value+'&timestamp='+timestamp, true)
    xmlHttp.send(null);
    }
    }

    function HandleGetData(div,xmlHttp)
    {

    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")

    {
    // ctrl.innerHTML=xmlHttp.responseText;
    // alert(xmlHttp.responseText);
    document.getElementById(div).innerHTML=xmlHttp.responseText
    //LoadWindow();
    }

    }
    function HandleGetData()
    {
    if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")

    {

    ctrl.innerHTML=xmlHttp.responseText;
    LoadWindow();
    }

    }

    function GetXmlHttpObject()
    {

    var xmlHttp=null;

    try

    {

    // Firefox, Opera 8.0+, Safari

    xmlHttp=new XMLHttpRequest();

    }

    catch (e)

    {

    // Internet Explorer

    try

    {

    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");

    }

    catch (e)

    {

    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");

    }

    }

    return xmlHttp;

    }
    on line
    document.getElementById(div).innerHTML=xmlHttp.responseText
    but everything is working fine all browsers except IE.

    Thanks
  • jitupkp
    jitupkp
    104 Posts
    ACCEPTED ANSWER

    Re: unknown runtime error in IE when dynamically populating select box

    ‏2014-09-20T11:42:25Z  in response to vn412

    get more help

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