Hi,
I am trying to send an ajax request in the onunload event of a page. I am using the $.post function of jquery, but when the event actually fires i get this error: "Microsoft JScript runtime error: '$' is undefined"
Does this mean that the jquery library has been deferenced before the $.post function was called and so i will not longer be able to use Jquery?
What should be my approach to solve this problem? I am doing this in an Asp.net 2.0 web application project. Following is the JS script on the page.
<script type="text/javascript">
function RemoveFromOnlineUsers()
{
debugger;
if ($.browser.msie)
{
alert("this is msie!");
}
$.post("../Main/FloatingWindowAjax.aspx", {REMOVEONLINEUSER : "<%=Master.UserId.ToString() %>" });
return false;
}
window.onunload = RemoveFromOnlineUsers;
</script>