Web design and hosting, database, cloud and social media solutions that deliver real business results
  • Database Services
    • Technical Articles
      • Get Open Query
      • SQL Server Data
      • SQL Server Maintenance
      • Using SQL Server Dates
      • Using SQL Server Functions
      • Using SQL Server Pivot-Unpivot
    • Technical Tools
      • Claytabase Server Disk IOPs Calculator
      • SQL Code Backup
      • SQL Printer
      • Stored Procedure Field Generator
  • Web Services
    • Logo Design
    • Open Projects
      • Site Management Project
    • Web Site Optimisation
      • Blog Micro-Site or Landing Page?
      • Keeping Content Natural
      • How do I minimise HTML?
      • Should I use a CDN?
      • Should I use HTTPS?
      • What is SEO?
    • Website Security
    • Technical Articles
      • Using ASP-NET
      • Using CSS
      • Using JavaScript
    • Technical Tools
      • Colour Picker
      • CSS Optimiser
      • JavaScript Optimiser
      • Lightbox
  • Cloud Services
    • Microsoft Azure
    • Microsoft Office
    • Technical Articles
      • Requesting SSL and Generation of PFX file in OpenSSL Simple Steps
      • Task Scheduler Error 2147943645
  • Social Media Services
    • Using Social Media
      • Asking for a Google Review
      • Changing a Facebook account from personal to business
      • Choosing where to focus Social Media effort
      • Social Media Image Sizes
      • Using Meta Data to set Social Media Images
  • About
    • Blog
      • Building Ousia Content Management System
      • Google Core Update Jan 2020
      • Hot Chilli Internet Closure
      • How To Choose Content For Your Website Adverts Leaflets
      • Preventing Online Scam
      • Skimmers of the gig economy
      • The most annoying things about websites on the Internet
    • Portfolio
    • Team
      • Chester Copperpot
      • Gavin Clayton

Optimise JavaScript for a faster web site

Copy the contents of your file into the left hand side box, and you will get returned optimised script in the other. Perfect for transition from development to live.

About

This tool is designed to bring down the size of JavaScript files, and while this will help, it can't make decisions like what your file includes and where it should be within your site, and how you use it. 

Initial coding had reductions of between 5% and 15% dependent on code styling, however in our latest update we have increased it to up to almost 25%.

We've been using this for a number of years internally, so have confidence in it, however if you find it breaks your code then please feel free to contact us.

Test JavaScript

function nextElSibling(el) {
    if (el.nextSibling)
        do { el = el.nextSibling } while (el && el.nodeType !== 1);
    return el;
}
function prevElSibling(el) {
    if (el.previousSibling)
        do { el = el.previousSibling } while (el && el.nodeType !== 1);
    return el;
}
function upElSibling(el) {
    do { el = el.parentNode; } while (el.nodeType !== 1);
    return el;
}
function upElSiblingA(el) {
    try {
        do { el = el.parentNode; } while (el.tagName.toLowerCase() !== "a");
        return el;
    }
    catch (err) {
        return el;
    }
}

Return JavaScript

function nextElSibling(el){
if(el.nextSibling)
do {el=el.nextSibling }while (el && el.nodeType !== 1);return el;}function prevElSibling(el){
if(el.previousSibling)
do {el=el.previousSibling }while (el && el.nodeType !== 1);return el;}function upElSibling(el){
do {el=el.parentNode;}while (el.nodeType !== 1);return el;}function upElSiblingA(el){
try {
do {el=el.parentNode;}while (el.tagName.toLowerCase()!== "a");return el;}catch (err){
return el;}}

Our services

database maintenance | database design | web site design | web site hosting | web site security | cloud services | social media

© 2016 Claytabase Ltd, registered company in the UK 08985867

Quick links

RSS Login ContactCookie PolicySitemap

Find us on social media

facebook.com/Claytabaseinstagram.com/claytabase/twitter.com/Claytabaselinkedin.com/company/claytabase-ltd

Get in touch

+441983 300 796info@claytabase.co.ukGround Floor, Building 1000, Lakeside North Harbour, Western Road, Portsmouth, Hampshire, United Kingdom, PO6 3EZ

Partners and memberships

Ousia logo
The settings on this site are set to allow all cookies. These can be changed on our Cookie Policy & Settings page.
By continuing to use this site you agree to the use of cookies.
Ousia Logo
This application can be installed to your home page
Ousia CMS Loader