Click here to Skip to main content
16,022,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
XML
<html>
    <head>
        <script type="text/javascript">
            var ajax=false;
            if(window.XMLHttpRequest)
                {
                    ajax=new XMLHttpRequest();
                }else{
                    ajax=new ActiveXObject("Microsoft.XMLHTTP");
                }
            function grab_data(data_source,div_id)
            {
                    var ob=document.getElementById(div_id);  
                    ajax.onreadystatechange=function()
                    {
                        if(ajax.readyState == 4&& ajax.status == 200)
                        {
                            ob.innerHTML=ajax.responseText;
                        }
                    }
                    ajax.open("get",data_source);
                    ajax.send(null);
                }
                
          
        </script>
        <title></title>
    </head>
    <body>
        
        <form>
            <input type="submit" value="Go ahead"  önClick="grab_data('file.txt','div_left')"/>

        </form>
        <div align="center" id="div_left">When you click on the button
            this line will be change .</div>
    </body>
</html>
Posted
Updated 22-Jun-11 8:41am
v2
Comments
Manfred Rudolf Bihy 22-Jun-11 14:43pm    
Now what's your problem?
What is going wrong?
Hamada Moahmed Ahmed 25-Jun-11 4:50am    
the result not showing "the value on the file not showing in the browser"

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900