www.webdeveloper.com
Results 1 to 2 of 2

Thread: Code works in FF but not in IE

  1. #1
    Join Date
    Feb 2010
    Posts
    2

    Thumbs up Code works in FF but not in IE

    Hi All,

    I am trying to create a client-side script, which will import URLs from an XML file and show fade-in fade-out effect.
    Code:
    <html>
    <body>
    
    <div align='right'>
    
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <script type="text/javascript" src="js/fadeslideshow.js"></script>
    <script type="text/javascript">
    
    var myCars=new Array(); // regular array (add an optional integer
    var imageobj=new Image();
    var xmlDoc;
    if (window.XMLHttpRequest)
      {
      xhttp=new XMLHttpRequest();
      }
    else // Internet Explorer 5/6
      {
      xhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    
      xhttp.open("GET","xml/textcontent1.xml",false);
      xhttp.send("");
     
      xmlDoc=xhttp.responseXML;
    
      x=xmlDoc.getElementsByTagName("PAGEID");
        
            for (i=0;i<x.length;i++)
            {
                txt=x[i].firstChild.nodeValue;
                myCars[i]= new Array();
                myCars[i][0]=txt;
                myCars[i][1]="";
                myCars[i][2]="";
            }
        var mygallery2=new fadeSlideShow({
        wrapperid: "fadeshow2", //ID of blank DIV on page to house Slideshow
        dimensions: [666, 467],
        imagearray: myCars,
        displaymode: {type:'auto', pause:5000, cycles:0, wraparound:false},
        persist: false, //remember last viewed slide and recall within same session?
        fadeduration: 2000, //transition duration (milliseconds)
        descreveal: "always",
        togglerid: "fadeshow2toggler"
    })
    </script>
    <div id="fadeshow2"></div>
    <div id="fadeshow2toggler" style="width:666px; text-align:center; margin-top:0px"></div>
    </div>
    </body>
    </html>
    This code works in FF and not in IE. Can anyone please help ..
    Last edited by Kor; 03-01-2010 at 08:05 AM. Reason: wrap the code [code][/code]

  2. #2
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Which part does not work? The AJAX request of the fade? In which version of IE ?

    Anyway, your document has no Doctype, which is definitely required, and no HEAD. Usually all the javascript codes are to be written in the HEAD section of your document. Make your code standard compliant, first. Whenever you must handle XML files, you should use an XHTML Doctype (and XHTML syntax as well).

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles