summary refs log tree commit diff
path: root/root/static/search.js
blob: 64f04a3306f5aeed12e2900159643535a70b37dd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
$(function() {
    $("#submit").click(function() {
        $('#spinner').show();
        $('#view').hide();
        var q = $("input#q").val();
        var engine= $("select#engine").val();
        var dataString = 'q='+ q + '&engine=' + engine;
        $.ajax({
            type: "POST",
            url: "cloud/search",
            data: dataString,
            success: function(response) {
                $('#view').show().html(response);
                $('#spinner').hide();
            }
        });
        return false;
    });
    $("#random_cloud").click(function(){
        $('#spinner').show();
        $.ajax({
            type: "GET",
            url: "cloud/random",
            success: function(response) {
                $('#view').show().html(response);
                $('#spinner').hide();
            }
        });
        return false;
    });

});