[Solved] How to get array json on to the view? |
I have this ajax script on success it gets a response which is array.
Code: [{"aid":"17","pid":"0","uid":"4","posthash":"581ebfc0e8657","filename":"IMG_20161027_153658.jpg","filetype" Code: <script type="text/javascript"> But I need to be able to display it on my view How can I Code: <div class="row"> On success full uploads it gets the current files $attachments PHP Code: public function upload_attachment() {
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
I have a solution here that I found
Please let me know if any thing better using Code: response.forEach(function(element) { Code: <script type="text/javascript">
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
great dude, hope this thread can help another people with the same case
Caffeine IT Solutions | Bina Darma University
You can also do this.
PHP Code: echo json_encode($attachments); What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |