views:

27

answers:

0

Okay, so here z the scenario, I have to create a myspace application which will have a .NET backend. from my current research n all I have found that this shud be my architecture:

  • A .NET application which uses handlers and the handlers use a function to write the output in an XML file on the server
  • A javascript front end for the myspace canvas surface/profile surface/home page surface which will read the xml file and show the result on the myspace appropriate surface.

I have created a .NET application using handlers and hosted it on a website. the XML is correctly being generated and all. the only problem i m experiencing is to get the javascript read the XML file. Following is my Myspace code which I am using on canvas surface:

           <div align="left">
            <table align="left" class="style1">
    <tr>

                    <td>
                       <div id="message1"></div>
                    </td>
                </tr>      

            </table>
        </div>


        <script type="text/javascript">
           function init(){
                 loadTags();       
            } 

         function loadTags()
         {
          var html;
  xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
            xmlDoc.async = false;

            xmlDoc.load("http://myservername.com/mytags.xml");
            var x = xmlDoc.getElementsByTagName("UserTag");
var tb, t;
       for (i = 0; i < x.length; i++) {

                tb = x[i].getElementsByTagName("taggedBy")[0].childNodes[0].nodeValue;
                t = x[i].getElementsByTagName("tagTitle")[0].childNodes[0].nodeValue;
html+="<BR>tagged by:" + tb + "<BR>tag:" + t;
}
        //document.getElementById('message1').innerHTML=html;         
         }   

            init();  
        </script>

My application doesnt show any result. Can anyone plz suggest what shud i try. Also another question; currently i m just trying to load the xml and read it, but my actual scenario will be to call the .net handler using javascript n then pick the xml file to read it. How will I call the handler using javascript if for example my handler is located here: http://mywebsitename.com/getTags.ashx?