adictomohaa
New Member
During my Ajax call I'm getting this error\[quote\] TypeError : :Unable to get value of the property 'nodeName': object is null or undefined\[/quote\]Here is my ajax code\[code\]function _Initialize_Chart() {var selectedDeptId = $(ddlQueues).val();var selectedDate = $(txtDate).val();$.ajax({ type: "GET", url: ajaxCallHandlerUrl, cache: false, data: { OpCode: "GetCallAverageHourlyReportForGraph", Params: "DeptId^" + selectedDeptId + "~Date^" + selectedDate }, dataType: "xml", beforeSend: function () { document.getElementById(chartdiv).style.backgroundImage = "url('../images/ajax-loader_new_.gif')"; }, success: function (responseString) { document.getElementById(chartdiv).style.backgroundImage = ""; _Load_Chart(responseString); }, error: function (xhr, errorType, exception) { document.getElementById(chartdiv).style.backgroundImage = ""; var errorMessage = exception || xhr.statusText; alert("There was an error Initializing Charts :: " + errorMessage); }});\[/code\]And here is my c# code\[code\]private string GetCallAverageHourlyReportForGraph(string parameterString){ Hashtable parameters = GetParameterCollection(parameterString); string deptId = Convert.ToString(parameters["DeptId"]); string date = Convert.ToString(parameters["Date"]); CallCenterBLLManager callCenterManager = new CallCenterBLLManager(); DataTable dtCallAverageMonthlyChartModel = callCenterManager.GetCallAverageHourlyDetailsForGraph(deptId, date); XmlDocument doc = new XmlDocument(); XmlDeclaration dec = doc.CreateXmlDeclaration("1.0", null, null); doc.AppendChild(dec); XmlElement data = http://stackoverflow.com/questions/13746817/doc.CreateElement("Data"); doc.AppendChild(data); if (dtCallAverageMonthlyChartModel.Rows.Count > 0) { foreach (DataRow currentRow in dtCallAverageMonthlyChartModel.Rows) { XmlElement row = doc.CreateElement("Row"); XmlElement xHour = doc.CreateElement("Hour"); xHour.InnerText = currentRow["Hour"].ToString(); XmlElement answeredCalls = doc.CreateElement("AnsweredCalls"); answeredCalls.InnerText = Convert.ToString(currentRow["AnsweredCalls"]); XmlElement abandonedCalls = doc.CreateElement("AbandonedCalls"); abandonedCalls.InnerText = Convert.ToString(currentRow["AbandonedCalls"]); row.AppendChild(xHour); row.AppendChild(answeredCalls); row.AppendChild(abandonedCalls); data.AppendChild(row); } } return doc.InnerXml.ToString();}\[/code\]Its returning xml from the c# code but den it directly goes to the error portion of jquery Ajax.Here is the returned xml\[code\]<?xml version="1.0" ?> <Data> <Row> <Hour>0</Hour> <AnsweredCalls>0</AnsweredCalls> <AbandonedCalls>0</AbandonedCalls> </Row> <Row> <Hour>1</Hour> <AnsweredCalls>0</AnsweredCalls> <AbandonedCalls>0</AbandonedCalls> </Row> <Row> <Hour>2</Hour> <AnsweredCalls>0</AnsweredCalls> <AbandonedCalls>0</AbandonedCalls> </Row> <Row> <Hour>3</Hour> <AnsweredCalls>0</AnsweredCalls> <AbandonedCalls>0</AbandonedCalls> </Row> ... (all the way through to .... <Row> <Hour>23</Hour> <AnsweredCalls>0</AnsweredCalls> <AbandonedCalls>0</AbandonedCalls> </Row></Data>\[/code\]