Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save PardotGists/6a00e02c9284b576b946 to your computer and use it in GitHub Desktop.
Save PardotGists/6a00e02c9284b576b946 to your computer and use it in GitHub Desktop.
Optimizing Advanced Dynamic Content Performance second sample
<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