tags:

views:

58

answers:

1

Alright, well this is the deal.

I have a page, and then it loads an iframe.

When anything inside the iframe is clicked, the main page (iframe parent) just reloads.

How can I have it, so that if the iframe parent is reloaded from a click inside the iframe that a certain boolean or something is passed, displaying something different.

For the iframe, I was using

opener.location.reload();

Thanks

+1  A: 

Rather than simply reloading, you could set the location.href back to itself, but add a querystring with the value you want to pass. Exactly how you want to do this will depend on whether the parent will already have a querystring, and whether you need to preserve that querystring. One option would be something like

var loc = opener.location;
loc.href = loc.protocol + "//" + loc.host + loc.pathname + "?myNewField=myNewValue";

(this will trim off any existing querystring or hash and add your new value as a querystring)

JacobM
the only downside about this is that i'm using mod rewrite to make the urls look nice, and I don't really want to have to make a new field for this particular thing. But thanks :D I may do that!
Belgin Fish