Question: Why js window.location is not accept a variable that assigned from json,
I hava checked my json, and the json is exist by console.log(myJsonCallback)

```
 Object { status=1,  action="update",  id=90}

```

The code like this,

```
if(response.action === "update"){ 
   var id = response.id;window.location.href=
       "/index.php?r=kasir%2Ftransaction%2Fview&id=id"}

```

in browser, little funny coz it gives me :

```
http://10.60.36.79/index.php?r=kasir%2Ftransaction%2Fview&id=id

```

Please advice

**UPDATE**

My original code like this :

```
. 'if(response.action === "update"){'
   . ' var id = response.id;'
   . 'window.location.href= "' . Url::toRoute(['view']) . '&id=${id}"'
  . '}'

```

See, I use dot(.) cos the code is a string on php

Please advice

Answer: 
In your code, `"/index.php?r=kasir%2Ftransaction%2Fview&id=id"`, this entire line is a single string without any variable. You will have to concatenate this string with the actual id.

Like this : 

```
if(response.action === "update"){ 
    var id = response.id;
    window.location.href = "/index.php?r=kasir%2Ftransaction%2Fview&id=" + id ;
}

```
Thanks all, my bad,
Perhaps not sleep until morning today.

this is the code 

```
   . 'if(response.action === "update"){'
        . ' var id = response.id;'
        . 'window.location.href= "' . Url::toRoute(['view']) . '&id=" + id'
   . '}' 

```

Please, up again