1

I have an iframe on my website, and the page that the iframe is of accepts referrals in the form of queries, ie /iframepage?r=123 . Obviously any person accessing the page the iframe is on, (mainwebsite/page?r=123) wouldn't be able to get the benefits of the referral. Is there any way i can make the iframe load based on the the queries in the main url?

Thanks

2 Answers2

0

You can pass url parameters to where you load the iframe. So you'd have to get the params off the url you are on, and then create the iframe in Javascript and load them on the url. Check this question How to pass parameters through iframe from parent html?

MattJHoughton
  • 1,040
  • 13
  • 19
0

I'd use something like the following:

var param = 'yourParameter'
document.getElementById('yourIFrame').src = 'http://example.com?param=' + param;
ACOMIT001
  • 510
  • 1
  • 7
  • 21