Error: $.each is not a function - Framework7 v2

Hello there,

Am trying to fetch some data using Ajax call but for some reasons I get not a function error. I tried some solutions here (tagged .each error) but none seems to solve my problem

Here is my code:

   return {
        methods: {
            fetchBtn: function() {
                var $ = this.$;
                var app = this.$app;

                app.request({
                    method: 'POST',
                    url: 'my-fetch-url',
                    crossDomain: true,
                    cache: false,
                    success: function(data) {
                        var obj = JSON.parse(data);
                        var result = "<ul>"
                        $.each(obj, function(x, dat) {
                            result = result + "<li>" + this['uni_name'] + " , " + this['uni_country'] + " , " + this['uni_city'] + " , " + this['uni_budget'] + " , " + this['uni_courses'] + " , " + this['uni_intakes'] + "</li>";
                        });
                        result = result + "</ul>"
                        $("#result").html(result);
                    }
                });

            }

Please assist me, cheers :slightly_smiling_face:

Plz use the forum search:

1 Like