title: How to get MVC ActionResult in External Javascript File
body: <p>I am confuse how to achieve this </p>
  
  <p>I have a external javascript file let say script.js and one <code>&lt;div&gt;</code> tag in HTML file.
  for example</p>
  
  <pre><code>&lt;script src='script.js Full Path'&gt;&lt;/script&gt;
  &lt;div id="div1"&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>Now, in my script.js file, i have ajax get function which calls Controller Action like below</p>
  
  <pre><code> $(function () {
  
   var url = 'http://www.example.com/controller/GetHTML';
     $.get(url, function (data) {
  
          $('#div1').html(data);
  
      });
   });
  
   and Controller Action is
  
    public ActionResult GetHTML()
      {
          return View();
      } 
  
    and view for GetHTML Action is 
  
      @{
      ViewBag.Title = "GetHTML";
      Layout = null;
       }
  
     &lt;h2&gt;This is HTML View&lt;/h2&gt;
  </code></pre>
  
  <p>Now, i want render View as <code>HTML</code> in to <code>div1</code>, Even if i am not sure it's possible or not</p>
  
  <p>So, Please any guys can help me to achieve above, it will really help me a lot.</p>