Hi Everyone,
In the code there are two methods, 1st method should read the text from the same domain that is example.com, and the 2nd function should read the text from different domain that Google.com/example.txt. Could any please let me know who to do this. I'm not sure whether I have framed the question properly. Please ask me if you do not understand my question.
//Ajax Question
//The html file path is http://example.com/example.html
<html>
<head>
<script type="text/javascript">
function Click1()
{
var div=// read the text from http://example.com/example.txt
document.getElementById("div1").innerHTML = div;
}
function Click2()
{
var div=// read the text from http://google.com/example.txt
document.getElementById("div2").innerHTML = div;
}
</script>
<body>
<input type="Button" Value="Button 1"name="textbox" onClick="Click1();"/>
<div id="div1">
</div>
<input type="Button" Value="Button 2"name="textbox" onClick="Click2();"/>
<div id="div2">
</div>