my code :
function my_template_jquery() {
wp_enqueue_script( '/js/games.js' );
}
add_action( 'wp_enqueue_scripts', 'my_template_jquery' );
//////////////////////////////////////////////////////////////////
// Register games Metabox
//////////////////////////////////////////////////////////////////
$prefixg = 'games_';
$game_box = array(
'id' => 'game-meta-box',
'title' => 'gamesprofile',
'page' => 'post',
'context' => 'normal',
'priority' => 'high',
'fields' => array(
array(
'name' => 'GameName',
'desc' => 'add game name here',
'id' => $prefixg . 'gname',
'type' => 'form',
'std' => ''
),
array(
'name' => 'game lists',
'desc' => '',
'id' => $prefixg . 'glist',
'type' => 'echogame',
'std' => ''
),
array(
'name' => 'add your game ID here',
'desc' => 'add gameID',
'id' => $prefixg . 'gameid',
'type' => 'text',
'std' => ''
),
array(
'name' => 'platforms',
'desc' => 'chose your platforms',
'id' => $prefixg . 'platforms',
'type' => 'text',
'std' => ''
)
)
);
add_action('admin_menu', 'game_add_box');
// Add meta box
function game_add_box() {
global $game_box;
add_meta_box($game_box['id'], $game_box['title'], 'game_show_box', $game_box['page'], $game_box['context'], $game_box['priority']);
}
// Callback function to show fields in meta box
function game_show_box() {
global $game_box, $post;
// Use nonce for verification
echo '<input type="hidden" name="game_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
echo '<table class="form-table">';
foreach ($game_box['fields'] as $field) {
// get current post meta data
$gmeta = get_post_meta($post->ID, $field['id'], true);
echo '<tr>',
'<th style="width:20%"><label for="', $field['id'], '">', $field['name'], '</label></th>',
'<td>';
switch ($field['type']) {
case 'text':
echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $gmeta ? $gmeta : $field['std'], '" size="30" style="width:97%" />', '<br />', $field['desc'];
break;
case 'form':
// define variables and set to empty values
echo '<form method="post" autocomplete="on" action="("admin/process_form.php");">
<input type="text" name="gname" >
<input type="submit"name="submit" value="search">', $gmeta ? $gmeta : $field['std'], '</form>', '<br />', $field['desc'];
break;
case 'echogame':
echo '<div id="MyResultsDiv"> ', $gmeta ? $gmeta : $field['std'], '</div>', '<br />', $field['desc'];
break;
}
echo '</td><td>',
'</td></tr>';
}
echo '</table>';
}
all work fines i just want know where is my problem to resulte game names under the search game i just need call my JS for show results