# Script runs correctly in FF 3.5, not in IE 8

**URL:** <https://forum.kirupa.com/t/script-runs-correctly-in-ff-3-5-not-in-ie-8/298748>\
**Category:** web dev\
**Created:** [October 23, 2009, 10:43pm UTC](https://forum.kirupa.com/t/script-runs-correctly-in-ff-3-5-not-in-ie-8/298748 "2009-10-23T22:43:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![halcyon\_systems](https://avatars.discourse-cdn.com/v4/letter/h/aeb1de/32.png) [@halcyon\_systems](https://forum.kirupa.com/u/halcyon_systems)\
**Post date:** [October 23, 2009, 10:43pm UTC](https://forum.kirupa.com/t/script-runs-correctly-in-ff-3-5-not-in-ie-8/298748/1 "2009-10-23T22:43:49Z")

</div>

Hello all,  
I wrote the following script, but am unsure as to reasons it will not work in IE8.

```auto
<script type="text/javascript">
    function GetXmlHttpObject() {
        var xmlhttp;
        if (window.XMLHttpRequest) {
            // code for IE7+, Firefox, Chrome, Opera, Safari
            xmlhttp = new XMLHttpRequest();
        }
        else if (window.ActiveXObject) {
            // code for IE6, IE5
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
        else {
        alert("Your browser does not support XMLHTTP!");
        }
        return xmlhttp;
    } // end of FUNCTION
    
    
    function loadContent(listingNum) {
        var URLString = new String();
        var dataString = new String();
        var ajaxObject = GetXmlHttpObject();
        
        if (listingNum == 0) {
            URLString = "http://development.ctcba.org/index.php?option=com_content&id=63&format=raw"; 
        }
        else {
            URLString = "http://development.ctcba.org/index.php?option=com_certification&format=raw&listingnum=" + listingNum;
        }
        
        ajaxObject.open("GET", URLString, true);
    
        ajaxObject.send(null);
        
        ajaxObject.onreadystatechange = function() {
            if (ajaxObject.readyState != 4) {
                document.getElementById('curr_cert_3').innerHTML = 'Loading...';
            }
            if (ajaxObject.readyState == 4) {
                
                dataString = ajaxObject.responseText;
    
                if (listingNum == 0) {
                    document.getElementById('edu_right').innerHTML = dataString;
                }
                else {
                    if (window.ActiveXObject) {
                        var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
                        
                        xmlDoc.async = false;
                        xmlDoc.loadXML(dataString);
                        root = xmlDoc.childNodes.item(1);
                    }
                    // code for Mozilla, Firefox, Opera, etc.
                    else if (document.implementation && document.implementation.createDocument) {
                        var xmlDoc = (new DOMParser()).parseFromString(dataString, "text/xml");
                        var root = xmlDoc.childNodes.item(0);
                    }
                    else {
                        alert('Your browser cannot handle this script');
                    }
                    
                    var node = root.getElementsByTagName("listingText")[0];
                    
                    if (window.ActiveXObject) {
                        var listingTextXML = root.childNodes.item(0).firstChild.data;
                    }
                    else if (document.implementation && document.implementation.createDocument) {
                        var listingTextXML = root.childNodes.item(1).firstChild.data;
                    }
                    document.getElementById('curr_cert_3').innerHTML = listingTextXML;
                }
            }
        }
    
    } // end of FUNCTION

```

Any help would be greatly appreciated.
