When I load an asp file (Main_Page_1.asp), in the click event of a button there is a function invocation is not working. There is I am stuck in.
for eg:-
Main_Page_1.asp
<head><script type="text/javascript" src="JsFile.js"></script>
<script type="text/javascript">
function buttonClicked ()
{
var xmlHttp;
try
{
xmlHttp=new XMLHttpRequest(); }
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("Your browser does not support AJAX!");
return false;
}
}
}
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
document.getElementById("ajaxResult").innerHTML='';
document.getElementById("ajaxResult").innerHTML= xmlHttp.responseText;
}
}
xmlHttp.open("GET","Result_Page_2.asp" ,true);
xmlHttp.send(null);
}
</script>
</head>
<body >
<div id=”ajaxResult”></div><button onclick="buttonClicked()">click me</button></body>
Result_Page_2.asp
<head><script type="text/javascript" src="JsFile.js"></script>
</head>
<body >
<a rel="HSTIP" herf=”Details_page.asp”>Details</a><div style="width: 178px" id="HSTIP"
class="MTStyle" >My Mouse Tool Tip</div></body>
This is the asp files (Result_Page_2.asp) I am trying to load using ajax. Now buttonClicked() residing in JsFile.js are not executed while the event happens.
In the JsFile.js file is used to load mouse tip window in the mouse over of “Details” hyperlink
Please let me know where things go wrong.