" window.history.pushState"并使用PHP $ _GET检索这些URL参数

时间:2016-07-01 22:11:28

标签: php jquery

对于index.php文件(以及其他相关的php文件),我需要使用screenheight(sh)和screenwidth(sw)的值。当用户输入index.php作为url然后使用window.history.pushState将刷新url(而不是页面)并显示screenheight和width。

如何以PHP GET参数的形式访问这些URL参数值...... $ _ GET [&#39; sw&#39;] / $ _GET [&#39; sh&#39;] ?? < / p>

window.history.pushState({sw:$(window).width(),sh:$(window).height()}, "Test page", "?sw=" + $(window).width() + "&sh=" + ($(window).height()));

var param = history.state; // param['sw']     /    param['sh']

0 个答案:

没有答案