Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within HTML Pages with CSS and JavaScript
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
HTML Pages with CSS and JavaScript
Ajax: ResponseXML is null
Deepika Singh
Greenhorn
Posts: 21
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
hi all,
I have started doing an application using ajax but I am getting the responseXML is null.
the respective code for the ajax :-
function AjaxSubmit(firstRec, init) { alert("HEllo................ start of ajax function................"); var tabObj = document.getElementById('dataTable'); var indObj = document.getElementById('indicatorRegion2'); urlArr = new Array(); tabObj.style.display = ''; indObj.style.display = ''; resetTable(tabObj, 1); alert(".... inside of ajax function................"); try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer 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; } } } alert("....first record>>>."+firstRec); var url = "hdiits.htm?actionFlag=get; xmlHttp.onreadystatechange = function() { if(xmlHttp.readyState == 4) { if(xmlHttp.status == 200) { alert(xmlHttp.responseText); var XMLtext=xmlHttp.responseXML; alert(".... inside of ajax function......value of XMLtext.........."+XMLtext); var XMLDoc = xmlHttp.responseXML.documentElement; alert(".... inside of ajax function......value of xmlDoc.........."+XMLDoc); indObj.style.display = 'none'; if(XMLDoc!=null) { var abc = XMLDoc.getElementsByTagName('value'); ('com.tcs.sgv.fms.valueobject.PaginationCustomVO'); var displayData = XMLDoc.getElementsByTagName('com.tcs.sgv.wf.valueobject.WfDocNotificationListVo'); var bColor = ""; if((rSize==0)||(displayData.length==0)) { alert("No Records found to display..."); return; } for (var i=0 ; i < displayData.length ; i++ ) { if((i%2)==0) bColor = "rgb(255,255,255)"; else bColor = "rgb(233,233,233)"; RSubject = displayData[i].childNodes[1].text; RNum = displayData[i].childNodes[2].text; RReferenceNumber = displayData[i].childNodes[3].text; RDescription = displayData[i].childNodes[4].text; RFromUser = displayData[i].childNodes[5].text; RRecvDate = displayData[i].childNodes[6].text; RLocation = displayData[i].childNodes[7].text; RPriority = displayData[i].childNodes[8].text; urlArr[url] = RReferenceNumber; var row = tabObj.insertRow(); row.style.backgroundColor = bColor; var cell1=row.insertCell(0); var cell2=row.insertCell(1); var cell3=row.insertCell(2); var cell4=row.insertCell(3); var cell5=row.insertCell(4); var cell6=row.insertCell(5); var cell7=row.insertCell(6); var cell8=row.insertCell(7); cell2.innerHTML=RSubject; if(RReferenceNumber=='#') cell3.innerHTML=RNum; else cell3.innerHTML='<a >'+RNum+'</a>'; cell4.innerHTML=RDescription; cell5.innerHTML=RFromUser; cell6.innerHTML=RRecvDate; cell7.innerHTML=RLocation; cell8.innerHTML=RPriority; } else { alert("Error Encountered"); } } } } xmlHttp.open("POST", encodeURI(url) , true); xmlHttp.setRequestHeader("Content-Type", "text/xml; charset=iso-8859-1"); xmlHttp.send(encodeURIComponent(null)); }
Sagar Rohankar
Ranch Hand
Posts: 2908
1
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Please
UseCodeTags
Also post the server side code, where you're constructing the XML response.
[LEARNING bLOG]
|
[Freelance Web Designer]
|
[and "Rohan" is part of my surname]
Eric Pascarello
author
Posts: 15385
6
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Read and follow this:
http://radio.javaranch.com/pascarello/2006/09/12/1158096122600.html
Eric
What are your superhero powers? Go ahead and try them on this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
how to submit dynamic row generated in JSP using struts
Issue with Download using ZipOutputStream
Blank Line inserting in a table,when rows are added dynamically.can anyone help?
Problem in onclick radio and dynamically populated table
how to implement dynamic rows paging when user clicks next or previous links
More...