The following code inside the tags gives error: "Object Expected".
<!-- JQuery/AJAX-->
<script type="text/javascript">
try {
$(document).ready(function(){
$("p").load(function(){
MakeRequest('divElectionCategory','ulElectionCategory','SELECT * FROM electioncategorymaster', 'UnOrderedList');
});
});
}
catch(e)
{
alert(e.message);
}
</script>
The MakeRequest function resides in a separate .js file and I have included that file before the above given code.
Which object it is referring to?
Edited: The MakeRequest function
function MakeRequest(DivName, ControlName, SqlQuery, ControlType)
{
var xmlHttp = getXMLHttp();
var strUrl = "";
if (ControlType = 'DropDown')
strUrl = "../phplibraries/filldropdown.php?DivName=" + DivName + "&DropDownControlName=" + ControlName + "&SqlQuery=" + SqlQuery;
else
strUrl = "../phplibraries/createelectioncategorymenu.php?DivName=" + DivName + "&ulName=" + ControlName + "&SqlQuery=" + SqlQuery;
alert(strUrl);
try
{
xmlHttp.onreadystatechange = function()
{
if (xmlHttp.readyState == 4)
{
HandleResponse(xmlHttp.responseText, DivName);
}
}
xmlHttp.open("GET", strUrl, true);
xmlHttp.send(null);
}
catch(err)
{
alert(err);
}
}
I know there is a big security issue above but please ignore it at this point of time.