Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/451.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 通过链接将值从一个jsp传递到另一个jsp_Javascript_Html_Jsp - Fatal编程技术网

Javascript 通过链接将值从一个jsp传递到另一个jsp

Javascript 通过链接将值从一个jsp传递到另一个jsp,javascript,html,jsp,Javascript,Html,Jsp,在我的第一个jsp中,我使用GoogleAPI获得了附近商店的列表及其其他属性,如商店名称、纬度、经度等 在我的第二个jsp中。我想要用户从第一个jsp中显示的列表中选择的特定存储的纬度和经度 我试图通过href传递纬度和经度的值,但不知为什么我不能。 下面是我的代码: side_bar_html += "<tr><td>" + place.geometry.location.toUrlValue(6) + "</td><td><a href

在我的第一个jsp中,我使用GoogleAPI获得了附近商店的列表及其其他属性,如商店名称、纬度、经度等

在我的第二个jsp中。我想要用户从第一个jsp中显示的列表中选择的特定存储的纬度和经度

我试图通过href传递纬度和经度的值,但不知为什么我不能。 下面是我的代码:

side_bar_html += "<tr><td>" + place.geometry.location.toUrlValue(6) + "</td><td><a href='second.jsp?key='+place.geometry.location.toUrlValue(6)>" + "LINK" + "</a></td></tr>";

我觉得你的html标记有点不对劲。缺少包含href属性的结束撇号:

side_bar_html += "<tr><td>" + place.geometry.location.toUrlValue(6) + "</td><td><a href='second.jsp?key=" + place.geometry.location.toUrlValue(6) + "'>" + "LINK" + "</a></td></tr>";
您应该检查生成的源代码并确认href有效。另外,请尝试直接转到second.jsp?key=test以确认您的jsp正确读取了请求参数

side_bar_html += "<tr><td>" + place.geometry.location.toUrlValue(6) + "</td><td><a href='second.jsp?key=" + place.geometry.location.toUrlValue(6) + "'>" + "LINK" + "</a></td></tr>";