Why don’t this work?
function write(){
writeOutPath("td");/*Don't work to pass arguments this way?*/
}
function writeOutPath(theSearchWord){
var theUrlToGoTo = "";
var currentUrl = window.location.href;
var aPosition = currentUrl.indexOf(theSearchWord); /*This becomes undefined, why???*/
for(i=0; i< aPosition.length;i++){
theUrlToGoTo=(theUrlToGoTo + currentUrl.charAt(i));
}
document.getElementById('testning').innerHTML =theUrlToGoTo + aPosition.length;
/*window.location("www.hulenet.se");*/
}