How to Get the Current Script’s Parent in Javascript

The following is a method of getting the current script’s parent, which may be useful if, for example, you need to append HTML in the same location as the script: var scripts = document.getElementsByTagName(‘script’); parent = scripts[scripts.length – 1].parentNode; The above code maintains the assumption that the currently executing script …

WordPress Disqus Popular Threads Widget Using Pure Javascript (Updated)

WpDisqusPt, or WordPress Disqus Popular Threads Widget, is a small script that you can drop into a Text Widget in WordPress. This widget shows which threads on your site are the most commented on, similar to Engadget’s old Most Commented widget. UPDATE 04-12-2013: WpDisqusPt is now on GitHub! https://github.com/ronaldcs/wp-disqus-pt UPDATE …