Skip to content

Tag Archives: JavaScript

JavaScript: get domain from url with JS regex

07-Nov-18

It's as simple as url.match(/\/\/(.[^/]+)/)[1]. Requires the double slash before the domain part, but not a slash after it.

New in JavaScript ES6

24-Jul-18

ES6 introduces new operators and concepts, like spread operator and Sets. Introduction to ES6+

Show Popular Posts on WordPress like Tim Ferriss

11-Mar-12

Tim's blog uses DOMTabĀ for tabbing the top lists of popular posts. Tabs are populated with WordPress Popular Posts plugin and some manual lists as well. Remember to allow shortcodes in sidebar. Then add a text widget with something like: <div class="domtab"> <ul class="domtabs"> <li class="active"><a class="domtab1" href="#t1" style="cursor:pointer;">Current hits</a></li> <li><a class="domtab2" href="#t2" style="cursor:pointer;">All time</a></li> <li><a […]

Load jQuery Slideshow After Page Has Loaded

17-Feb-11

I needed a slideshow that would load (in a way, asynchronously) after the page has been loaded and would show something without JavaScript. This solution requires jQuery and jQuery Cycle plugin (lite version will do). <div id="slideshow"> <img src="default-image.jpg" alt="" /><!--defaults to this image without javascript --> </div> <script type="text/javascript"> $(document).ready(function() { //// random slides […]

JavaScript to Footer in WordPress

20-Jan-10

Want to move that jQuery and other js references from header to footer? Try JavaScript to Footer plugin.