PDA

View Full Version : ajax and print data in the div,help me.


crazyman
07-29-2008, 03:46 PM
At first sorry about my bad English.
So now i have 3 files : quey_db.php, jaxFunction.js and index.php.

My question is how do i can print my data which retrieved from file query_db.php by ajaxFunction.js in my div tags.I'm a new to ajax and i just know to print into a div.If i do that, i have to code again many querys to my database for each my div tags ?

Someone can help me? Thanks in advance!!!

abduraooft
07-29-2008, 04:22 PM
If it's plain text, then you could use innerHTML property (http://www.w3schools.com/htmldom/prop_anchor_innerhtml.asp)

crazyman
07-29-2008, 05:06 PM
Yes i know about innerHTML property but how do i do ?data retrieved from my database is a big string and i dont know how to arrange my data into div tags ? i have too many div and dont know how to divide my data ?

ohgod
07-29-2008, 06:10 PM
if you're looking to break it up and drop it into different div's you're probably going to need to do it with xml. if you're just trying to drop the big string all into one then just use innerhtml and tell it which div by id

crazyman
07-29-2008, 07:28 PM
Oh thank everybody very much and a special thank to ohgod.
So i will try with xml.But im a new to it :D.