I have a page that is included as an iframe
in my site. I need to supply the searched keyword to that page for DFP attribute and so I am setting the searched keyword as a global variable and now I need to retrieve the global variable in that iframe. So is it possible, and if so, how?
问问题
1299 次
2 回答
3
You can not access global variable in iframe because both will be separate request to server.
Either you need to pass variable as paramater in iframe src or you need to bind session variable in parent page and use that session value in iframe page.
于 2012-06-26T05:32:53.037 回答
2
You don't access this global variable in iframe because of limited scope. You can pass this variable in quarystring parameter. As like for example :-
<?php
var $param="test";
echo "<iframe src='test.php?param=".$param."'></iframe>";
?>
I hope it may helps!!
于 2012-06-26T05:12:51.347 回答