Printing HTML Attritbutes with jquery in a loop

301
November 22, 2016, at 10:03 AM

i try to loop trough Objects in a Database (parse.com) and would like to print these results with attributes from Bootstrap. I'm a beginner and don't understand why it's not possible how i did it. i know there is .attr() but i don't get it how i can use this in my example.

This is my code:

    var Insider = Parse.Object.extend("Insider");

          function getPosts() {
            var query = new Parse.Query(Insider);
            query.find({
                success: function(results) {
                    var output = "";
                    for (var i in results) {
                        var name = results[i].get("name");
                        var catego = results[i].get("cate");
                        var imageurl = results[i].get("image");  
                        var tpp = results[i].get("tipp");
                            output += "<ul class="media-list">";
                            output += "<li class="media">";
                            output += "<div class="media-left">";
                            output += "<a href="#">";
                            output += "<img id = "two" class="media-object"
alt="...">"
output += "<h4>+ + name + "</h4>";                            
output += "</a>"
                            output += "</div>"
                    }
                    $("#list").html(output);
                }, 
                error: function(error){
                    console.log("Query error:" + error.message);
                }
            });
          }
                getPosts();
    });    

Any help much appreciated!

Rent Charter Buses Company
READ ALSO
Need help parsing jquery datatables editor data

Need help parsing jquery datatables editor data

I have a data format that I receive from jquery data tables editor Datatables Editor which looks like the one below and I need to parse it so that I can store it into db but I have not figured out a way of doing so. .

385
Disable browser&#39;s autocomplete textboxes in asp.net c#

Disable browser's autocomplete textboxes in asp.net c#

How to disable browser's autocomplete effect on all textboxes in asp. net c# application.

421
Validate Input only on blur or loose focus

Validate Input only on blur or loose focus

I am using - victorjonsson/jQuery-Form-Validator.

363