Template:Ways to Give/PayPalSelect: Difference between revisions

From Donate
Jump to navigation Jump to search
Content deleted Content added
wrap in window load
wrap in mw.loader.using
Line 12: Line 12:
<script>
<script>
window.addEventListener('load', function() {
window.addEventListener('load', function() {

// Add tracking info to links
// Add tracking info to links
$('#currency-list a').attr('href', function(i, val) {
mw.loader.using( ['mediaWiki.Uri'], function() {

var uri = new mw.Uri(val);
$('#currency-list a').attr('href', function(i, val) {
uri.extend({
utm_medium: 'Waystogive',
var uri = new mw.Uri(val);
utm_campaign: 'C11_Waystogive',
uri.extend({
utm_source: 'Waystogive'
utm_medium: 'Waystogive',
utm_campaign: 'C11_Waystogive',
utm_source: 'Waystogive'
});
return uri.toString();
});
});

return uri.toString();
});
});

});
});
</script>
</script>

Revision as of 18:52, 20 September 2017