stevanicus
12-27-2007, 01:10 AM
Hi,
I have a simple bloging/comments system that has a form - this form then uses an xmlHttp request, where my asp file extracts data from my database and creates an xml form.
However Im having problems controlling the output of the database. I want it to display everything with is does according to the SQL query. however i might want to display certain things in different ways e.g. bold italic etc.
However it just displays it in one big set and i can touch any of the data.
what am i doing wrong? and what do i need to be looking into?? thanks
stevanicus
AJAX
function blog()
{
var xmlDoc=xmlHttp.responseXML.documentElement;
document.getElementById("tBlog").innerHTML=xmlHttp.responseText;
document.getElementById("bgId").innerHTML=
xmlDoc.getElementsByTagName("blogId")[0].childNodes[0].nodeValue;
document.getElementById("bgbody").innerHTML=
xmlDoc.getElementsByTagName("blogBody")[0].childNodes[0].nodeValue;
document.getElementById("bgmadeBy").innerHTML=
xmlDoc.getElementsByTagName("blogAuthor")[0].childNodes[0].nodeValue;
}
HTML
<div id="tBlog">
<b><span id="bgId"></span></b><br />
<span id="bgbody"></span><br />
<span id="bgmadeBy"></span>
</div>
thanks again
I have a simple bloging/comments system that has a form - this form then uses an xmlHttp request, where my asp file extracts data from my database and creates an xml form.
However Im having problems controlling the output of the database. I want it to display everything with is does according to the SQL query. however i might want to display certain things in different ways e.g. bold italic etc.
However it just displays it in one big set and i can touch any of the data.
what am i doing wrong? and what do i need to be looking into?? thanks
stevanicus
AJAX
function blog()
{
var xmlDoc=xmlHttp.responseXML.documentElement;
document.getElementById("tBlog").innerHTML=xmlHttp.responseText;
document.getElementById("bgId").innerHTML=
xmlDoc.getElementsByTagName("blogId")[0].childNodes[0].nodeValue;
document.getElementById("bgbody").innerHTML=
xmlDoc.getElementsByTagName("blogBody")[0].childNodes[0].nodeValue;
document.getElementById("bgmadeBy").innerHTML=
xmlDoc.getElementsByTagName("blogAuthor")[0].childNodes[0].nodeValue;
}
HTML
<div id="tBlog">
<b><span id="bgId"></span></b><br />
<span id="bgbody"></span><br />
<span id="bgmadeBy"></span>
</div>
thanks again