Petty_Crim Posted December 28, 2007 Share Posted December 28, 2007 I'm making a simple Ajax thing that fetches data from a mysql database and then it sticks it in a new row in an existing table. I've got the main bit working but I'm stuck with the responseText function. Since that only returns one big string and I have multiple columns which need to be seperate its kind of useless as I need to stick individual values in different cells not in 1 big cell. Is there another way where I can return the data as kind of like separate variables? Quote Link to comment Share on other sites More sharing options...
priti Posted December 29, 2007 Share Posted December 29, 2007 Hello, Two ways you can do 1.create the html in php and return i.e your responseText='<td>name</td><td>age</td><td>class</td>' and print this directly. 2.return a string with a delimiter name-age-class hence your response text would be name-age-class then in javascript your can split this with the help of delimiter '-' and show as you want in the javascript. Hope it helps Regards Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.