When I want to redirect, the variable where is always udefined. But, for example, I want put that variable in alert(); it shows correct number.
code
var where = msg.txt;
window.location = "/page.php?id=".where; //this redirects to /page.php?id=undefined
alert(where); //it show correct number
In JavaScript,
.is used for property access, not for string concatenation like in PHP.Use
+instead: