javascript split
<pre><code>&lt;script language="javascript"&gt;
function frompost()
{
  var string=$('#indexsearch').val();
  var url=string.split('=');
  if(url==""){
  var url=string.split('video/');  
  }
  var finalurl='http://watchvideos.tv/watch/'+url[1];
  window.location = finalurl;
  //$('#srchFrm').attr('action',finalurl);
  //document.srchFrm.submit();
}
&lt;/script&gt;
</code></pre>

<p>I have a problem with this script - it's Ok as long as indexsearch field contains <code>=</code> and fails when it's supposed to work as well - with <code>video/</code> in the field</p>
