Jump to content
funbinod

appending new element with php returned array

Recommended Posts

i am trying to create new element that contains a php returned array in it.

$( "#invoice" ).append( '<td id="item"><script>getData("items.php", "item")</script></td>');

the array is returned from 'items.php' and is called with simple ajax technique. its not working, or simply i don't know how can i do that. can anyone please guide me or suggest me some better technique...?

Share this post


Link to post
Share on other sites

I don't understand what the problem is. What code are you using? You print the data from the array presumably the same way that your function is doing it now.

Share this post


Link to post
Share on other sites

i was using simple ajax method to getData stored on 'items.php' and insert it on the "<td id='items'> </td>"

 

i've this already in my page.

<td id="item"><script>getData("items.php", "item")</script></td>

it displays everything fine. i wish to add this same line again. but when i .append this element it doesn't work..

Share this post


Link to post
Share on other sites

That's because appending an element that contains Javascript does not cause the Javascript to get executed. That's why I said to load the data first via ajax, then put the data on the page.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...