Created
March 5, 2018 23:14
-
-
Save amirkhan81/d61b53a656cfa33adc9367b2858e42da to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.getJSON("mydata.json", function(data) { | |
var html = ''; | |
$.each(data, function(key, value){ | |
html += '<div class="dcell">'; | |
html += '<img src="images/'+value.product+'.png"/>'; | |
html += '<label for="'+value.product+'">'+value.name+':</label>'; | |
html += '<input type="text" id="'+value.product+'" name="'+value.product+'" value="0" stock="'+value.stock+'" price="'+value.price+'" required>'; | |
html += '</div>'; | |
}); | |
$('#yourContainerId').html(html); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment