Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
themeEclipse
firstline1
titlejQuery prototype
linenumberstrue
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
    <title>prototype</title>
    <script src="jquery.js" type ="text/javascript"></script>
</head>
<body>
<h1>Dashboard</h1>
<ul id="ul"></ul>
</body>
</html>
<script>
    $(function(){

        $.ajax({
            type : 'GET',
            url : 'dashboard.json',
            async : false,
            beforeSend : function(){/*loading*/},
            dataType : 'json',
            success : function(result){
                let buffer="";
                $.each(result, function(index, val){

                    for(let i=0; i < val.length; i++){
                        let item = val[i];
                        console.log(item.name);
                        buffer+=" <li>Auto: "+item.car+" Coureur: "+ item.driver+"</li><button>Kijk mee</button>";
                    }
                    $('ul').html(buffer);
                });
            }
        });
    });
</script>

Resultaat

Figuur 2: Resultaat jQuery

Hoe scoren de frameworks op de criteria

...