yuguang / fiddlesalad

An online playground with an instantly ready coding environment. Combine language preprocessors, CSS, HTML and JavaScript to create and share coding examples.
fiddlesalad.com
GNU General Public License v3.0
232 stars 80 forks source link

javascript incorrectly reads commented out code #16

Closed ImaginaryDevelopment closed 11 years ago

ImaginaryDevelopment commented 11 years ago

the commented out { in the following code makes fiddlesalad fail to render.

var c = $('#container');
$.each(operations, function (i, e) {
    //foreach( var e in operations){

    var input = document.createElement('input');
    $(input).attr('type', 'button').val(e.key)
        .attr('id', e.id)
        .addClass('operation')
        .attr('title', e.id);

    c.append(input);

    $('input#' + e.id).on('click', function () {
        showcalc(e.f);
    });
});