Created
September 25, 2015 17:17
-
-
Save PardotGists/6a00e02c9284b576b946 to your computer and use it in GitHub Desktop.
Optimizing Advanced Dynamic Content Performance second sample
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
<script type="text/javascript"> | |
$(function(){ | |
$('[data-dc-url]').each(function(idx, el) { | |
var $el = $(el); | |
var dcUrl = $el.data('dc-url'); | |
$.ajax( { | |
'url': dcUrl + '?ajax', | |
'xhrFields': { | |
'withCredentials': true | |
}, | |
'success': function(data) { | |
$el.html(data); | |
} | |
}); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment