ShowAnchors.js

javascript:(function(){function%20a(n,t){return'<a%20href="'+loc+"#"+n+'"%20title="'+t+":%20"+n+'"%20style="text-decoration:none;padding:.2em;background:#fff;border:1px%20solid%20black;display:block;position:absolute;z-index:2147483647;border-radius:3px;-webkit-box-shadow:0%203px%207px%20rgba(0,0,0,0.3);box-shadow:0%203px%207px%20rgba(0,0,0,0.3)">#'+n+"</a>"}var%20$,loc=location.href,anchorPos=location.href.lastIndexOf("#");anchorPos>-1&&(loc=loc.substring(0,anchorPos)),function(u,c){var%20h=document.getElementsByTagName("head")[0],s=document.createElement("script");s.src=u;var%20d=!1;s.onload=s.onreadystatechange=function(){d||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(d=!0,c(),s.onload=s.onreadystatechange=null,h.removeChild(s))},h.appendChild(s)}("//code.jquery.com/jquery-3.3.1.min.js",function(){$=jQuery,$("a[name]").each(function(i){$(a(this.name,"name")).insertBefore(this)}),$("[id]:not(input[type='hidden'])").each(function(i){switch(this.nodeName){case"TD":$(this).prepend(a(this.id,"id"));break;default:$(a(this.id,"id")).insertBefore(this)}})})})();
Improved “Show Anchors” bookmarklet from Ingo Karkat’s https://gist.github.com/inkarkat/cd1d40996a1f818dfc71, which is an improvement on the bookmarklet here: http://sensefulsolutions.com/2009/12/show-anchors-bookmarklet.html

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.