User:Svick/HarvErrors.js
// Usage: add importScript(User:Svick/HarvErrors.js); to Special:Mypage/skin.js
// See also Wikipedia:Centralized discussion/Citation discussion#Technical discussion regarding Harvard Refs
// This script works fine for Harvard references in tags, but for inline Harv. refs,
// the error message shows up at the end of the paragraph in which the error is
error = " Harv error: this link doesn't point to any citation.";
jQuery(document).ready(function($) {
links = document.links;
for (i=0; i < links.length; i++)
{
href = links[i].getAttribute('href');
if (href.indexOf('#CITEREF') == 0)
if (document.getElementById(href.substring(1)) == null)
links[i].parentNode.innerHTML += error;
}
});