title: Display random image using Ajax
body: <p>Hi everyone i'm trying to display some random images while <strong>not loading (refresh) page</strong> </p>
  
  <p>So how can i display random images on a page without refreshing the page ?</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(function () {
          $.ajax({
              type: "get", url: "Home/Oku", data: {}, dataType: "json",
              success: function (data) {
                  for (var i = 0; i &lt; data.length; i++) {
                     var newFirmDiv= $(' &lt;img src="../../banner_image/' + data[i] + '" width="154px" height="108px"/&gt;');
                     $(".firmShowCase").append(newFirmDiv);
                  }
              }
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>Here is my action method that provides return values an array</p>
  
  <pre><code> public ActionResult Oku()
      {
          var query = from table in db.news select table.news_image_name;
          return Json(query, JsonRequestBehavior.AllowGet);
      }
  </code></pre>
  
  <p>Here is result as you can see below</p>
  
  <p><img src="https://i.stack.imgur.com/MAIi6.jpg" alt="enter image description here"></p>