Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.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通过网页进行数据通信_Javascript_Php_Html - Fatal编程技术网

使用JavaScript通过网页进行数据通信

使用JavaScript通过网页进行数据通信,javascript,php,html,Javascript,Php,Html,我是web开发新手,我对javascript有一个问题 在网页1上,我有一个用javascript显示的表格。可以单击表中的每个元素,并将您发送到网页2,显示有关此元素的更多信息 我如何将单击的网页1元素传达给网页2? 是否有一种方法可以使用&_GET和&_排序的包含我的脚本的php页面,或者有一种等效的方法 更准确地说,我通过一个监听器在网页之间切换: function selectHandler(e) { window.location="display.php"; }; 如有必要

我是web开发新手,我对javascript有一个问题

在网页1上,我有一个用javascript显示的表格。可以单击表中的每个元素,并将您发送到网页2,显示有关此元素的更多信息

我如何将单击的网页1元素传达给网页2? 是否有一种方法可以使用&_GET和&_排序的包含我的脚本的php页面,或者有一种等效的方法

更准确地说,我通过一个监听器在网页之间切换:

function selectHandler(e) {
    window.location="display.php";
};

如有必要,您可以通过URL散列进行通信:

//webpage 1
window.location="display.php#elem1";
//webpage 2
if (window.location.hash === '#elem1') {...}

网页1和网页2是在同一个域吗?是的,很抱歉忘了提到它