title: Javascript - sending html code in string via Ajax
body: <p>How is the best way to send string from javascript to php with html tags inside? I'm trying, but all html tags disappear.</p>
  
  <pre><code>var ajaxData = '&lt;div&gt;some &lt;b&gt;text&lt;/b&gt;&lt;/div&gt;';
  
  jQuery.ajax({
              url: url,
              type: 'POST',
              dataType: 'json',
              data: ajaxData,
  });
  </code></pre>
  
  <p>but in my php code var_dump($input); shows string like that: 'some text' instead </p>
  
  <pre><code>'&lt;div&gt;some &lt;b&gt;text&lt;/b&gt;&lt;/div&gt;'
  </code></pre>
  
  <p>even this doesn't work</p>
  
  <pre><code>htmlspecialchars(urldecode($input));
  </code></pre>