PDA

View Full Version : why am I returning the index of pos1, and not the replacement?!?!



thenextbesthang
10-07-2006, 03:55 PM
var input = window.prompt("Enter Text Here", "[[blah|blah]]");
var pos1 = input.indexOf("[[");

for(i=pos1;i<=str4.length;i++)
{
if(str4.charAt(i) == "[[")
{
var pos1 = str4.replace("[[", '<a href="http://en.wikipedia.org/wiki/');
}