title: Post and get html data in laravel and javascript
body: <p>I want to post some HTML content to a route and show the processed HTML result in a new window. I have created a button for preview HTML</p>
  
  <pre><code>&lt;div class="form-group"&gt;
    &lt;input type="button" class="btn btn-danger" value="preview" onclick="tempopen();" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>in <code>tempopen</code> function I have created an ajax function for sending data to a route for showing preview HTML</p>
  
  <pre><code>url = "&lt;?php echo(URL::to('page_temp'))?&gt;";
  var title = document.getElementById("title").value;
  var leader = document.getElementById("leader").value;
  var content = document.getElementById("editor1").value;
  var image_show = document.getElementById("image_show").value;
  var imagelink = document.getElementById("image").src;
  var image = imagelink.substring(imagelink.lastIndexOf('/')+1);
  
  $.ajax({
              type: "POST",
              url: url,
              dataType: 'JSON',
              data: {title: title},
              success: function( data ) {
                  console.log(data);
              }
          });
  </code></pre>
  
  <p>and at last in <code>page_temp</code> route a simple function is written for testing receiving data and sending a feedback, but I have got this error
  POST XHR <a href="http://localhost/page_temp" rel="nofollow">http://localhost/page_temp</a></p>