indeed but this way, if the CDN are allowed, jquery-ui will never be loaded (you check window.jQuery for both). Also, instead of checking allow_cdn in the php, you could use an ELSE tag here, isn't it?