Skip to content

jQuery conflict caused by jester.js #71

@ghost

Description

On WP 5.1, with Disqus 3.0.17, the plugin seems to cause jQuery conflict with custom JS functions.

To Replicate, on a WP Homepage Template, if you have something like the following, it will throw a function not found error for your custom function:

<script>
  jQuery(window).load(function() {
       load_my_stuff();
  });
  function load_my_stuff () {
      console.log('d');
 }
</script>

It seems to come down to a conflict with jester.js, which is loaded on the page with count.js.

A quick fix is to remove count.js...provided you don't need it, by placing the following in your funcitons.php or functions plugin.

function filter_dsq_can_load( $script_name ) {
    // $script_name is either 'count' or 'embed'.
	if ( 'count' === $script_name ) {
		return false;
	}

	return true;
}
add_filter( 'dsq_can_load', 'filter_dsq_can_load' );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions