1jQuery(function () { 2 function getUrlParams(url) { 3 const params = {}; 4 if (url.indexOf('?') === -1) { 5 return {}; 6 } 7 const query = url.split('?', 2)[1]; 8 query.split('&').forEach(function(element){ 9 const [key, value] = element.split('='); 10 params[key] = value; 11 }); 12 return params; 13 } 14 15 jQuery('a').each(function () { 16 var href = this.href; 17 if (href.indexOf('?') === -1) { 18 // Links without query string are already handled correctly 19 return; 20 } 21 const params = getUrlParams(href); 22 if (params['do'] && params['do'] !== '' && params['do'] !== 'show') { 23 // don't prefetch actions other than show 24 return; 25 } 26 jQuery(this).attr('data-instant', 1); 27 }); 28}); 29