Difference between revisions of "MediaWiki:Common.js"
From Conceptual Reconstructionism Project
Thaumasnot (talk | contribs) |
Thaumasnot (talk | contribs) |
||
| Line 4: | Line 4: | ||
$('*[data-def]').click( function(){ | $('*[data-def]').click( function(){ | ||
var url = location.href; | var url = location.href; | ||
console.debug(this. | console.debug(this.attr('data-def')); | ||
location.href = "#" + this.dataDef; | location.href = "#" + this.dataDef; | ||
history.replaceState(null, null, url); | history.replaceState(null, null, url); | ||
}); | }); | ||
}); | }); | ||
Revision as of 21:15, 6 December 2021
/* Any JavaScript here will be loaded for all users on every page load. */
$(document).ready( function() {
$('*[data-def]').click( function(){
var url = location.href;
console.debug(this.attr('data-def'));
location.href = "#" + this.dataDef;
history.replaceState(null, null, url);
});
});