Wikipedia Viewer - ajax call difficulty

I am trying to get the json data from wikipedia. But, when I make my ajax call, nothing seems to be happening - no success data is logged nor is any error data logged. Here is the javascript code that I am using:

$(document).ready(function() {  
  $("#query").on("submit", function() {
    var root = "*&gsrlimit=10&gsrsearch=";
    var q = encodeURI($("#q").val());
    var cb = "&callback=?";
    var url = root + q + cb;
      url: url,
      type: "GET",
      dataType: "json",
      success: function(data) {
      error: function(error) {

What should I be doing differently?

I cleaned up your code.
You need to use triple backticks to post code to the forum.
See this post for details.

Thank you! I will make sure to do this next time.