Last active
December 12, 2015 08:58
-
-
Save robap/4747480 to your computer and use it in GitHub Desktop.
The difference between partial html ajax and json
This file contains 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
//partial html can simply be inserted into the dom | |
$('.ajax-content').html(data); | |
//json needs to be mapped | |
$('#form_id').val(data['id']); | |
$('#form_firstName').val(data['firstName']); | |
$('#form_lastName').val(data['lastName']); | |
$('#form_phone').val(data['phone']); | |
$('#form_street').val(data['street']); | |
$('#form_city').val(data['city']); | |
$('#form_state').val(data['state']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment