Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Compress multiple jQuery UI files into one?

Featured Replies

I'm using jQuery UI to make forms more intuitive. jQuery UI allows you to pick and choose the individual features you want.

 

The downside to this is rather than one file, you end up with lots....

 

I currently have the following:

 

	<script src="<?php bloginfo('template_directory'); ?>/js/jquery.ui.core.js"></script>
<script src="<?php bloginfo('template_directory'); ?>/js/jquery.ui.widget.js"></script>
<script src="<?php bloginfo('template_directory'); ?>/js/jquery.ui.position.js"></script>
<script src="<?php bloginfo('template_directory'); ?>/js/jquery.ui.autocomplete.js"></script>
<script src="<?php bloginfo('template_directory'); ?>/js/jquery.ui.datepicker.js"></script>

 

 

Would it be a good idea to chuck them all in to one file? I'm using other jQuery too, obviously, so right now I have another 4/5 files on top of that. I don't really want the page loading lots of Javascript files.

 

I'm used to using W3 Total cache on Wordpress...but I've had mixed results, quite often it breaks the files and you have to un-minify them, which kind of defeats the point.

You can download a custom minified package with only the components you want here.

 

To be honest, it's probably quicker to link to the whole jQuery UI package on Google's CDN instead - there's a good chance the user will already have cached it, and if they haven't it's on a separate domain so it won't count against your concurrent HTTP request limit.

Edited by Renaissance-Design

  • Author

I swear that's what I got and the minified files were still separate. I'll try again.

 

Can you link to a single minified file for what I need on the CDN?

Can you link to a single minified file for what I need on the CDN?

 

Nope. That would defeat part of the object anyway, as there'd be a far smaller chance of the user already having it cached.

Would it be a good idea to chuck them all in to one file? I'm using other jQuery too, obviously, so right now I have another 4/5 files on top of that. I don't really want the page loading lots of Javascript files.

 

An alternative, which I use, is HeadJS, which allows you to load multiple .js files in parallel. There is a version which includes the HTML5 Shiv and mini-Modernizr, and a version without. :D

Edited by Joe J

  • Author

Ah ok. I'll use the Google one then. At least it's reducing 6 files down to one! Just implemented it and everything seems fine.

 

I've got a lot of inline JS I need to sort out too.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.