Reputation: 5217
I have created a website called https:www.somePage.com
and I'm rendering this page inside another website using iframe
. Since I'm using the same iframe
in different websites, to track the website that using my https:www.somePage.com
I'm adding a parameter called page
in the iframe src. So the iframe will be like
<iframe src="https:www.somePage.com?page=company_name" width="100" height="250">
How can I access the parameter page
in my website https:www.somePage.com
.
Upvotes: 1
Views: 2679
Reputation: 1793
In javascript using location.search
you can get the parameters. But you've to split it and get the desired value.
Upvotes: 1
Reputation: 631
The webpage containing the iframe is considered the HTTP_REFERER in server terms, and the window.top.locarion.href in client terms. So based on your development environment, you can fetch that. In PHP that would be $ref = $_SERVER["HTTP_REFERRER"]
and in JS that would be window.top.location.href
, good luck.
Upvotes: 0