Title: javascript inside an admin menu?
Last modified: August 19, 2016

---

# javascript inside an admin menu?

 *  Resolved [tehjrow](https://wordpress.org/support/users/tehjrow/)
 * (@tehjrow)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/javascript-inside-an-admin-menu-1/)
 * This isn’t meant to be a double post but my other post is broken for some reason.
 * The alert() on this admin page doesn’t work, can I not put javascript here?
 *     ```
       <?php
   
       add_action('admin_menu', 'mt_add_pages');
       function mt_add_pages() {
       add_menu_page(__('Test Toplevel','menu-test'), __('Test Toplevel','menu-test'), 'manage_options', 'mt-top-level-handle', 'mt_toplevel_page' );
       }
       function mt_toplevel_page() {
           echo "<h2>" . __( 'Test Toplevel', 'menu-test' ) . "</h2>";
   
       echo "<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js'></script>
       <script language='text/javascript'>
   
       alert('test');
               </script>
       ";
   
       ?>
   
       <div id='test'>asdf</div>
   
       <?php
   
       }
   
       ?>
       ```
   

Viewing 1 replies (of 1 total)

 *  Thread Starter [tehjrow](https://wordpress.org/support/users/tehjrow/)
 * (@tehjrow)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/javascript-inside-an-admin-menu-1/#post-1833472)
 * Haha i’m an idiot….
 * <script language=’text/javascript’>
    should be <script type=’text/javascript’
   >

Viewing 1 replies (of 1 total)

The topic ‘javascript inside an admin menu?’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 1 participant
 * Last reply from: [tehjrow](https://wordpress.org/support/users/tehjrow/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/javascript-inside-an-admin-menu-1/#post-1833472)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
