title: Ajax code is not working in html
body: <p>I am trying to get all content of two.html in onw.html page by using ajax but don't knw its not working in short in have to develop one page application n url should not load below in have posted my code.</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;script src="https://code.jquery.com/jquery-2.1.4.min.js"&gt;&lt;/script&gt;
          &lt;script&gt;
              // Check browser support
              function demo()
              {
                  var name=document.getElementById('dd').value;
  
                  if (typeof(Storage) !== "undefined") {
                      // Store
                      localStorage.setItem("lastname", name);
                      // Retrieve
                  } else {
                      document.getElementById("result").innerHTML = "Sorry, your browser does not support Web Storage...";
                  }
              }
  
              $(document).ready(function(){
                  $("button").click(function(){
  
                  $.ajax({
                      url: "two.html",  
                      success: function(result){
                          $("#result").html(result);
                      }});
                  });
              });
          &lt;/script&gt;
      &lt;/head&gt;
  
      &lt;body&gt;
          &lt;div id="result"&gt;&lt;/div&gt;
          &lt;input id="dd" type="text" onblur="demo()" &gt;
          &lt;br/&gt;
          &lt;button&gt;two&lt;/button&gt;
          &lt;br/&gt;
          write something &amp; click on link it will redirect to another page.
          close this page and open three.html page.
  
          &lt;br/&gt;
          &lt;img src="1.png" alt="da" style="width:150px;height:150px"&gt;&lt;/img&gt;
      &lt;/body&gt;
  </code></pre>
  
  <h2>    </h2>
  
  <h1>two.html</h1>
  
  <pre><code>  &lt;!DOCTYPE html&gt;
    &lt;html&gt;
    &lt;body id="body"&gt;
  
    &lt;div id="result"&gt;&lt;/div&gt;
    &lt;label&gt;Second Page&lt;/label&gt;
    &lt;script&gt;
      if (typeof(Storage) !== "undefined") {
       document.getElementById("result").innerHTML = localStorage.getItem("lastname");
       } else {
       document.getElementById("result").innerHTML = "Sorry, your browser does  not support Web Storage...";
      }
     &lt;/script&gt;
     &lt;img src="2.gif" alt="da" style="width:150px;height:150px"&gt;&lt;/img&gt;
   &lt;/body&gt;
   &lt;/html&gt;
  </code></pre>