www.webdeveloper.com
Results 1 to 3 of 3

Thread: xml data to Html not working in Google Chrome

Hybrid View

  1. #1
    Join Date
    Jan 2013
    Posts
    3

    xml data to Html not working in Google Chrome

    hi i am working on a smallproject to display images from Xml to HTML page..It Works great on IE and FireFox But Not on Google Chrome this is my XML COde


    Code:
    <Data>
      <Details>
      <Id> 1 </Id>
      <Photo><![CDATA[<img src=../Seceret/photos/download.jpg width=150 height=150>]]></Photo>
      <Mindet> Hi one </Mindet>
      <Maxdet> Hi I am 1 </Maxdet>
      </Details>
      <Details>
      <Id> 2 </Id>
      <Photo><![CDATA[<img src=../Seceret/photos/download(2).jpg width=150 height=150>]]></Photo>
      <Mindet> Hi Two </Mindet>
      <Maxdet> Hi I am 2 </Maxdet>
      </Details> 
    <Data>
    and This is my HTMl Code

    HTML Code:
    <html>
    <head>
    <title>Profiles</title> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <link rel="stylesheet" href="js/jquery.mobile-1.2.0.min.css"/>
    <script src="js/jquery-1.8.3.min.js"></script>
    <script src="js/jquery.mobile-1.2.0.min.js"></script>
    
    <script type="text/javascript">
    var xmlDoc=null;
    if (window.ActiveXObject){
    xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
    }
    else if (document.implementation.createDocument){
    xmlDoc=document.implementation.createDocument("","",null);
    }
    else{
    alert('Browser cannot handle this script');
    }
    if (xmlDoc!=null){
    xmlDoc.async=false;
    xmlDoc.load("as.xml");
    
    var x=xmlDoc.getElementsByTagName("Details");
    for (i=0;i<x.length;i++)
    { 
    
    
    document.write(x[i].getElementsByTagName("Photo")[0].childNodes[0].nodeValue);
    document.write("<br/>");
    
    }
    
    }
    </script>
    </head></html>

    can any one please help me out as it is urgent

  2. #2
    Join Date
    Jan 2013
    Posts
    3
    can anyone help me out...

  3. #3
    Join Date
    Jan 2013
    Posts
    3
    check this out....

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