title: How to add own javascript/css file to wordpress plugin menu page?
body: <p>I want to write my first WordPress plugin and could need some help. I don't know how to add my javascript file to the dashboard area head when clicking on the menu item of my plugin. This is what I've done so far:</p>
  
  <p>1st step:
  created a directory and a php-file in the <code>wp-content/plugins</code> directory, added the head of the plugin like this:</p>
  
  <pre><code>/* Plugin Name: Test Plugin
  Plugin URI: http://my-plugin.com/
  Description: test test test
  Version: 1.0
  Author: me
  Author URI: http://my-plugin.com/
  License: GPLv2 or later
  */
  </code></pre>
  
  <p>2nd step:
  With this function I add my plugins name (top level menu item name) at the bottom of the dashboard menu. I dont even know why the name and the slug name are listed twice. I got that code from: <a href="http://codex.wordpress.org/Administration_Menus" rel="nofollow">here</a>. I also dont know what "mt-top-level-handle" does. There is no function for it and it still works. "manage_options" is the capability variable which defines the user permissions on this page. (Anyone knows how to make this page accessable for admins,(authors) only? )</p>
  
  <pre><code>add_action( 'admin_menu', 'register_my_menu_item' );
  function register_my_menu_item() {
       add_menu_page(__('top level menu item name','slug-name'), __('top level menu item name','slug-name'), 'manage_options', 'mt-top-level-handle', 'my_plugins_page' );
  }
  </code></pre>
  
  <p>3rd step:
  This simple function displays "Hello World" on the plugins page.</p>
  
  <pre><code>function edit_table_page() {
  ?&gt;
      &lt;h2&gt;Hello World&lt;/h2&gt;
  &lt;?php
  }
  </code></pre>
  
  <p>Now I'd like to know how to use my javascript file(s) on that plugins page. I need to add it after the jquery file is loaded.</p>
  
  <p>All I found about adding scripts was this:  </p>
  
  <pre><code>add_action('wp_enqueue_scripts', 'my_scripts');
  function my_scripts() {
     wp_enqueue_script('jquery'); 
     wp_register_script('my_script', plugins_url('js/my_script.js', __FILE__),array("jquery")); 
     wp_enqueue_script('my_script');
  }
  </code></pre>
  
  <p>That didn't work. So how to do it right? :)</p>