Window.location does not work

0

This script is intended to open a url by selecting value in asbox store the values in the vars redir, redir2 and redir 3

function redirect(){
var obj = document.getElementById("cat");  // 
var obj2= document.getElementById("sub1");
var obj3= document.getElementById("sub2");
var redir2=obj2.options[obj2.selectedIndex].text.substring(0,4); 
var redir =obj.options[obj.selectedIndex].text.substring(0,4); //
var redir3 =obj3.options[obj3.selectedIndex].text.replace(/ /g,"_");    

var url= redir+"/"+redir2+"/"+redir3+".php";
url=url.toLowerCase();

alert(url);

window.location.href = "np/categories/"+url;}

I can see that the browser is taking over the code line, but it does not open the test page created for this purpose

In the console of the mozilla I see this message:

GET link [HTTP / 1.1 200 OK 0 ms]

All the path is correct, however the page does not load, and simply reload the current page, where I make the selection.

What's wrong?

    
asked by anonymous 14.02.2017 / 03:03

0 answers