[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 449
  • Last Modified:

Need to reload parent from iFrame

I have a <TD> in an iFrame with onclick="parent.document.location='<<<parent.document.location>>>?Var1=1&Var2=2'

What should <<<parent.document.location>>> be?  I really just want to reload the parent but I will manually set the URL variables.
0
Brian Coughter
Asked:
Brian Coughter
  • 4
1 Solution
 
ZvonkoSystems architectCommented:
Like this:

onclick="parent.location=parent.location.href.split("?")[0]+'?Var1=1&Var2=2';"




0
 
ZvonkoSystems architectCommented:
Sorry, wrong quotes:

onclick="parent.location=parent.location.href.split('?')[0]+'?Var1=1&Var2=2';"


0
 
ZvonkoSystems architectCommented:
But that will ONLY work when parent is same Internet domain as iframe.

0
 
Brian CoughterOwnerAuthor Commented:
It will be.  Thanks!
0
 
ZvonkoSystems architectCommented:
You are welcome.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now