Deregistering and registering javascript breaks plugin
While you can view the [full file here][1], here's the function that enqueues the JavaScript file(s) needed by the plugin:

    function ippy_bcq_add_scripts() {
    
    $options = get_option('ippy_bcq_options');
    $valuebb = $options['bbpress'];
    $valueco = $options['comments'];
    $ippy_bcq_bbp_fancy = get_option( '_bbp_use_wp_editor' );
    
      if ( function_exists('is_bbpress') ) {
              if ( is_bbpress()  && ( $valuebb != '0') && !is_null($valuebb) && ($ippy_bcq_bbp_fancy == '0') ) {
                wp_enqueue_script("bcq_quicktags", plugin_dir_url(__FILE__) . "quicktags.js", array("quicktags","jquery"), "1.8", 1);
                wp_enqueue_style("bcq_quicktags", plugin_dir_url(__FILE__) . "quicktags.css", false, "1.8");
                wp_print_styles('editor-buttons');
            }
      }
      if ( comments_open() && is_singular() && ( $valueco != '0') && !is_null($valueco) ) {
                        wp_enqueue_script("bcq_quicktags", plugin_dir_url(__FILE__) . "quicktags.js", array("quicktags","jquery"), "1.8", 1);
                        wp_enqueue_style("bcq_quicktags", plugin_dir_url(__FILE__) . "quicktags.css", false, "1.8");
                        wp_print_styles('editor-buttons');
      }
    }
    
    if( !is_admin() ) {
    	add_action('wp_print_styles', 'ippy_bcq_add_scripts');
    }

Now, as you can see, `quicktags` ($handle) is one of the dependencies (alongside jQuery) required the JavaScript enqueued by the plugin.

`quicktags` represents this file: `http://example.com/wp-includes/js/quicktags.js`, and I need to have the file served from a different domain, like this for instance — `http://static-domain.com/wp-includes/js/quicktags.js`. How do I do it?

I tried these two in my theme's functions.php, but they seem to break the JavaScript output by the plugin for some reason:

 - **TRY - 1:**

        add_action('wp_enqueue_scripts','aahan_register_script');
        function aahan_register_script(){
        
        	wp_deregister_script('quicktags');
        	wp_register_script('quicktags', 'http://static-domain.com/wp-includes/js/quicktags.js', false, false, true);
        	wp_enqueue_script( 'quicktags' );
        
        }

 - **TRY - 2:**

        add_action('wp_print_styles','aahan_register_script');
        function aahan_register_script(){
        
        	wp_deregister_script('quicktags');
        	wp_register_script('quicktags', 'http://static-domain.com/wp-includes/js/quicktags.js', false, false, true);
        	wp_enqueue_script( 'quicktags' );
        
        }

I also did try a few other variants, but none worked. What am I doing wrong?

----

## More Info

By default the plugin outputs code like this in the footer:

    <script type='text/javascript'>
    /* <![CDATA[ */
    var quicktagsL10n = {"wordLookup":"Enter a word to look up:","dictionaryLookup":"Dictionary lookup","lookup":"lookup","closeAllOpenTags":"Close all open tags","closeTags":"close tags","enterURL":"Enter the URL","enterImageURL":"Enter the URL of the image","enterImageDescription":"Enter a description of the image","fullscreen":"fullscreen","toggleFullscreen":"Toggle fullscreen mode","textdirection":"text direction","toggleTextdirection":"Toggle Editor Text Direction"};
    /* ]]> */
    </script>
    <script type='text/javascript' src='http://example.com/wp-includes/js/quicktags.js?ver=3.4.1'></script>
    <script type='text/javascript' src='http://static-domain.com/wp-content/plugins/basic-comment-quicktags/quicktags.js?ver=1.8'></script>

But when I try the aforementioned functions, the output code is this (essentially broken):

    <script type='text/javascript' src='http://whatthenerd.com/wp-includes/js/quicktags.js?ver=3.4.1'></script>
    <script type='text/javascript' src='http://wtn-static.whatthenerd.net/wp-content/plugins/basic-comment-quicktags/quicktags.js?ver=1.8'></script>


  [1]: http://plugins.svn.wordpress.org/basic-comment-quicktags/tags/1.6/quicktags.php
Deregistering and registering javascript breaks plugin
===

While you can view the [full file here][1], here's the function that enqueues the JavaScript file(s) needed by the plugin:

    function ippy_bcq_add_scripts() {
    
    $options = get_option('ippy_bcq_options');
    $valuebb = $options['bbpress'];
    $valueco = $options['comments'];
    $ippy_bcq_bbp_fancy = get_option( '_bbp_use_wp_editor' );
    
      if ( function_exists('is_bbpress') ) {
              if ( is_bbpress()  && ( $valuebb != '0') && !is_null($valuebb) && ($ippy_bcq_bbp_fancy == '0') ) {
                wp_enqueue_script("bcq_quicktags", plugin_dir_url(__FILE__) . "quicktags.js", array("quicktags","jquery"), "1.8", 1);
                wp_enqueue_style("bcq_quicktags", plugin_dir_url(__FILE__) . "quicktags.css", false, "1.8");
                wp_print_styles('editor-buttons');
            }
      }
      if ( comments_open() && is_singular() && ( $valueco != '0') && !is_null($valueco) ) {
                        wp_enqueue_script("bcq_quicktags", plugin_dir_url(__FILE__) . "quicktags.js", array("quicktags","jquery"), "1.8", 1);
                        wp_enqueue_style("bcq_quicktags", plugin_dir_url(__FILE__) . "quicktags.css", false, "1.8");
                        wp_print_styles('editor-buttons');
      }
    }
    
    if( !is_admin() ) {
    	add_action('wp_print_styles', 'ippy_bcq_add_scripts');
    }

Now, as you can see, `quicktags` ($handle) is one of the dependencies (alongside jQuery) required the JavaScript enqueued by the plugin.

`quicktags` represents this file: `http://example.com/wp-includes/js/quicktags.js`, and I need to have the file served from a different domain, like this for instance — `http://static-domain.com/wp-includes/js/quicktags.js`. How do I do it?

I tried these two in my theme's functions.php, but they seem to break the JavaScript output by the plugin for some reason:

 - **TRY - 1:**

        add_action('wp_enqueue_scripts','aahan_register_script');
        function aahan_register_script(){
        
        	wp_deregister_script('quicktags');
        	wp_register_script('quicktags', 'http://static-domain.com/wp-includes/js/quicktags.js', false, false, true);
        	wp_enqueue_script( 'quicktags' );
        
        }

 - **TRY - 2:**

        add_action('wp_print_styles','aahan_register_script');
        function aahan_register_script(){
        
        	wp_deregister_script('quicktags');
        	wp_register_script('quicktags', 'http://static-domain.com/wp-includes/js/quicktags.js', false, false, true);
        	wp_enqueue_script( 'quicktags' );
        
        }

I also did try a few other variants, but none worked. What am I doing wrong?

----

## More Info

By default the plugin outputs code like this in the footer:

    <script type='text/javascript'>
    /* <![CDATA[ */
    var quicktagsL10n = {"wordLookup":"Enter a word to look up:","dictionaryLookup":"Dictionary lookup","lookup":"lookup","closeAllOpenTags":"Close all open tags","closeTags":"close tags","enterURL":"Enter the URL","enterImageURL":"Enter the URL of the image","enterImageDescription":"Enter a description of the image","fullscreen":"fullscreen","toggleFullscreen":"Toggle fullscreen mode","textdirection":"text direction","toggleTextdirection":"Toggle Editor Text Direction"};
    /* ]]> */
    </script>
    <script type='text/javascript' src='http://example.com/wp-includes/js/quicktags.js?ver=3.4.1'></script>
    <script type='text/javascript' src='http://static-domain.com/wp-content/plugins/basic-comment-quicktags/quicktags.js?ver=1.8'></script>

But when I try the aforementioned functions, the output code is this (essentially broken):

    <script type='text/javascript' src='http://whatthenerd.com/wp-includes/js/quicktags.js?ver=3.4.1'></script>
    <script type='text/javascript' src='http://wtn-static.whatthenerd.net/wp-content/plugins/basic-comment-quicktags/quicktags.js?ver=1.8'></script>


  [1]: http://plugins.svn.wordpress.org/basic-comment-quicktags/tags/1.6/quicktags.php