可以用GET来传递<script>
var a="xxx";
location.href="http://127.0.0.1/test.php?"+a;
</script>