title: How to pass javascript variable to ajax 'data' attribute
body: <p>I am tying to pass a javascript variable as an ajax paramater but it is being sent as null. Simply passing 'host' gives 'host' itself which isn't what is desired</p>
  
  <pre><code>var host = "some value"
  $.ajax({
    type: 'GET',
    url: '/Main/GetData/',
    data: '{'
    hostname '=' + host '}',
    dataType: 'json',
  
    success: function(json) {
      var data = json;
    },
  }); //ajax
  </code></pre>