title: Prevent script tags from executing on page load with form get
body: <p>I have a search page which has a form.</p>
  <pre><code>&lt;form method=&quot;get&quot; action=&quot;/search&quot;&gt;
    &lt;input type=&quot;text&quot; id=&quot;search&quot; name=&quot;search&quot; /&gt;
  &lt;/form&gt;
  </code></pre>
  <p>When I am loading the url with the search querystring, I am getting an alert, I would like to avoid this.</p>
  <pre><code>http://localhost/search?search=&lt;script&gt;alert(document.cookie)&lt;/script&gt;
  </code></pre>
  <p>I tried this but it isn't working,</p>
  <pre><code>$( document ).ready(function() {
  var search_value = $('#search').val();
  if(search_value !== '')
    {
     search_value = search_value.replace(/(&lt;([^&gt;]+)&gt;)/ig,&quot;&quot;);
     $('#search').val(search_value);
    }
  });
  </code></pre>
  <p>I would like to process the string before the loading, but I am unable to, any suggestions on how to fix this?</p>