Bug #3167048 Error when viewing table content/structure
[phpmyadmin/crack.git] / js / db_search.js
blobea7280b243829c2dbd3b5fd0972a6a28ad2ba08f
1 /* vim: set expandtab sw=4 ts=4 sts=4: */
2 /**
3  * @fileoverview    JavaScript functions used on Database Search page
4  * @name            Database Search
5  *
6  * @requires    jQuery
7  * @requires    js/functions.js
8  */
10 /**
11  * AJAX script for the Database Search page.
12  *
13  * Actions ajaxified here:
14  * Retrieve result of SQL query
15  */
17 $(document).ready(function() {
19     /**
20      * Set a parameter for all Ajax queries made on this page.  Don't let the
21      * web server serve cached pages
22      */
23     $.ajaxSetup({
24         cache: 'false'
25     });
27     /**
28      * Ajax Event handler for retrieving the result of an SQL Query
29      * (see $GLOBALS['cfg']['AjaxEnable'])
30      *
31      * @uses    PMA_ajaxShowMessage()
32      */
33     $("#db_search_form.ajax").live('submit', function(event) {
34         event.preventDefault();
36         PMA_ajaxShowMessage(PMA_messages['strSearching']);
38         $form = $(this);
40         if (! $form.find('input:hidden').is('#ajax_request_hidden')) {
41             $form.append('<input type="hidden" id="ajax_request_hidden" name="ajax_request" value="true" />');
42         }
44         $.get($form.attr('action'), $form.serialize() + "&submit_search=" + $("#buttonGo").val(), function(data) {
45             $("#searchresults").html(data);
46         }) // end $.get()
47     })
48 }, 'top.frame_content'); // end $(document).ready()