title: Javascript split ain't working on iPad (safari)
body: <p>Javascript ain't working for me ;-(</p>
  
  <pre><code>function myFunction() {
  
  var url = document.getElementById("value1").value;
  
  document.write(url.split('?')[0]);
  
  window.location = 'http://example.com/?s='+ url.split('?')[0];
   }
  </code></pre>
  
  <p>value1 = <a href="https://www.xxxxxxxxx.com/nl/p/yyyyyyyyyyyyyy/9200000056577975/?suggestionType=browse" rel="nofollow noreferrer">https://www.xxxxxxxxx.com/nl/p/yyyyyyyyyyyyyy/9200000056577975/?suggestionType=browse</a></p>
  
  <p>i only need the stuff before the questionmark (<a href="https://www.xxxxxxxxx.com/nl/p/yyyyyyyyyyyyyy/9200000056577975/" rel="nofollow noreferrer">https://www.xxxxxxxxx.com/nl/p/yyyyyyyyyyyyyy/9200000056577975/</a>)</p>
  
  <p>it is working on PC (IE, Opera,...), but it ain't on iPad (safari)
  I get this on ipad: <a href="https://www.xxxxxxxxx.com/nl/p/yyyyyyyyyyyyyy/9200000056577975/suggestionType=browse" rel="nofollow noreferrer">https://www.xxxxxxxxx.com/nl/p/yyyyyyyyyyyyyy/9200000056577975/suggestionType=browse</a></p>
  
  <p>What is wrong?</p>
  
  <p>update:
  I have added some code:</p>
  
  <pre><code>function myFunction() {
  
  var url = document.getElementById("value1").value;
  
  
  
  document.write(url.split('?')[0]);
  
  url = url.replace(/%2F/g,'/');
  url = url.replace(/%3A/g,'/');
  url = url.replace(/%3F/g,'?');
  
  window.location = 'http://example.com/?s=' + url.split('?')[0];
   }
  </code></pre>
  
  <p>it is working but safari is screwing up the urls that are added. Input box is used for urls. on PC all working as it should. the .replace are used to try edit the submitted urls but ain't working. Safari document.write still shows the right urls without the %2F and %3A .</p>