javascript – Loading script in Admin


I am trying to create a plugin in which (among other functions) someone can insert alternatives SKUs for a product.

I have created the form and a script in order to work dynamically.

enter image description here

When I try to load it from amin_head action it works, but it creates some small conflicts with other Plugins. For that reason, I have inserted the same script in another file named load-SKU.js and I placed it in Plugin’s Directory.

I am trying to load this from the following code and it not works.

function addjs(){
  wp_register_script('load-SKU', plugins_url( 'myCustomPlugin/loadSKU.js' , dirname(__FILE__) ), array( 'jquery' ), '1.0');
  wp_enqueue_script('load-SKU');
}
add_action('admin_enqueue_scripts','addjs', 2000);

I have read and test most of solutions in net but I cannot manage it.

Also, console throws me an error in finding another script only in this page, and I dont know how they can be connected.

enter image description here

The script is the following:

<script id="load-SKU-js">
jQuery(document).ready(function() {
  var i =document.addEditProduct.counterofRows.value;
  var nor=1;
  document.addEditProduct.numOfRows.value = i;
  jQuery('#addSKU').click(function() {
    i++;
    nor++;
    document.addEditProduct.numOfRows.value = i;
    jQuery('#dynamic_field').append('<tr id="row'+i+'"><td><input type="text" name="altSKU'+i+'" value=""><br></td><td><button type="button" name = "removeSKU" class="btn btn_remove" id= "'+i+'">Remove</button></td></tr>');
  });
  jQuery(document).on('click', '.btn_remove', function(){
    nor--;
    //document.addEditProduct.numOfRows.value = nor;
    var button_id = jQuery(this).attr("id");
    jQuery('#row'+button_id+'').remove();
  });

});
</script>

Any idea?