Customise Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

No cookies to display.

Dynamic Web Lab

Load jquery library from google CDN in wordpress

google cdn

Add this code on wordpress theme functions.php to deregister the urgent jquery and load jquery library from google.

[php] function load_cdn_jquery() {

// only use this method is we’re not in wp-admin
if (!is_admin()) {

// deregister the original version of jQuery
wp_deregister_script(‘jquery’);

// discover the correct protocol to use
$protocol=’http:’;
if($_SERVER[‘HTTPS’]==’on’) {
$protocol=’https:’;
}

// register the Google CDN version
wp_register_script(‘jquery’, $protocol.’//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js’, false, ‘1.5.2’);

// add it back into the queue
wp_enqueue_script(‘jquery’);

}

}

add_action(‘template_redirect’, ‘load_cdn_jquery’);
[/php]

Written by

Maidul Islam

I am a freelance web developer.Like to share what i learn.