Answers for "unserialize ajax data in php"

PHP
4

ob_start in php

ob_start(); //Start remembering everything that would normally be outputted, but don't quite do anything with it yet
$output = ob_get_contents(); //Gives whatever has been "saved"
ob_end_clean(); //Stops saving things and discards whatever was saved
ob_flush(); //Stops saving and outputs it all at once
Posted by: Guest on May-18-2020
0

vuejs get data fromo ajax

<script type="text/javascript">
var ItemsVue = new Vue({
    el: '#Itemlist',
    data: {
        items: []
    },
    mounted: function () {
        var self = this;
        $.ajax({
            url: '/items',
            method: 'GET',
            success: function (data) {
                self.items = JSON.parse(data);
            },
            error: function (error) {
                console.log(error);
            }
        });
    }
});
</script>

<div id="Itemlist">
    <table class="table">
        <tr>
            <th>Item</th>
            <th>Year</th>
        </tr>
        <tr v-for="item in items">
            <td>{{item.DisplayName}}</td>
            <td>{{item.Year}}</td>
        </tr>
    </table>
</div>
Posted by: Guest on February-28-2020

Browse Popular Code Answers by Language