通过javascript中的window.location传递数据

use*_*258 3 javascript php

我试图通过window.location传递数据,数据在del(id,img,album)中可用.

我想通过window.location发送多个值

 window.location="save.php?type=deldownload&album="+album&id="+id; 
Run Code Online (Sandbox Code Playgroud)

但这不起作用,但下面的代码可行.

function del(id,img,album){
    var where_to= confirm("Do you really want to delete "+img+" image");
    if (where_to== true)
    {
         window.location="save.php?type=deldownload&id="+id; 
    } 
    else
    {
         alert('Ok! You Can continue with this Album');
    }

}
Run Code Online (Sandbox Code Playgroud)

请告诉我们真正的问题是什么.

Mir*_*lav 6

你错过了一些引号

window.location="save.php?type=deldownload&album="+album+"&id="+id; 
Run Code Online (Sandbox Code Playgroud)