indexOf with variable string
<p>I'm having this problem with javascript/jQuery, I have this code  </p>

<pre><code>//settings is the array of options passed to the function
$input = $('#par_kw[ref="'+settings['ref'] +'"]')
var prev = $input.val();
alert(prev + ' : '+settings['new_kw']+' : '+ prev.indexOf(settings['new_kw'])); 
</code></pre>

<p>in run time I get messages like :  <code>maths, computing : maths : -1</code> always <code>-1</code> but when I tried constant <code>indexOf("maths")</code> it works and I get <code>0</code> or what ever the index of it<br>
can u see what I'm doing wrong?? cause I can't :(</p>

<h2>update</h2>

<p>oh well, this is even more confusing :/<br>
I tried JSFIDDLE.net <a href="http://jsfiddle.net/katkootable/DXyBY/1/" rel="nofollow">here</a> but it works just fine :(
could it be something wrong in files, because in my project I separate code into 2 file but I kept it simple in one file @ jsfiddle ?!!<br>
but that makes no sense!! where ever the instruction is, I'm making sure that the value is caught correctly in alert!</p>
